{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "NIL" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" }, { "data": { "text/plain": [ "FOO" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" }, { "name": "stdout", "output_type": "stream", "text": [ "Type (to-maxima) to restart, ($quit) to quit Maxima.\n", "Returning to Maxima\n" ] }, { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{1}$}{\\it bar}\\left(x , y\\right):=\\mathbf{block}\\;\\left(\\left[ \\right] , \\left(x:x+2 , y:y+2 , x:{\\it foo}\\left(y\\right) , x+y\\right)\\right)\\]" ], "text/plain": [ "(%o1) bar(x, y) := block([], (x : x + 2, y : y + 2, x : foo(y), x + y))" ], "text/x-maxima": [ "bar(x,y):=block([],(x:x+2,y:y+2,x:foo(y),x+y))" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" }, { "name": "stderr", "output_type": "stream", "text": [ "\n", "; file: CELL:417276200.MAC.NEWEST\n", "; in: DECLAIM (OPTIMIZE (DEBUG 3) (SAFETY 3) (SPEED 0))\n", "; (DECLAIM (OPTIMIZE (DEBUG 3) (SAFETY 3) (SPEED 0)))\n", "; \n", "; caught STYLE-WARNING:\n", "; DECLAIM where DECLARE was probably intended\n", "; \n", "; compilation unit finished\n", "; caught 1 STYLE-WARNING condition\n" ] } ], "source": [ "to_lisp();\n", "\n", "(declaim (optimize (debug 3)\n", " (safety 3)\n", " (speed 0)))\n", "\n", "(defun foo (x)\n", " (break)\n", " (print (+ x 3))\n", " (+ x 4))\n", " \n", "(to-maxima)\n", "\n", "bar(x,y) := block([],(\n", " x: x+2,\n", " y: y+2, \n", " x: ?foo(y),\n", " x+y));" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Bkpt 0: " ] }, { "name": "stderr", "output_type": "stream", "text": [ "[SIMPLE-CONDITION] break\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "; Evaluating call:\n", "; (+ X 3)\n", "; With unknown arguments\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "[SB-EXT:STEP-FORM-CONDITION] Evaluating call:\n", " (+ X 3)\n", "With unknown arguments\n", "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "; Evaluating call:\n", "; (PRINT (+ X 3))\n", "; With arguments:\n", "; 7\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "[SB-EXT:STEP-FORM-CONDITION] Evaluating call:\n", " (PRINT (+ X 3))\n", "With arguments:\n", " 7\n", "\n", "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "7 ; (PRINT (+ X 3)) => 7\n", "; Evaluating call:\n", "; (+ X 4)\n", "; With unknown arguments\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "[SB-EXT:STEP-FORM-CONDITION] Evaluating call:\n", " (+ X 4)\n", "With unknown arguments\n", "\n" ] }, { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{2}$}12\\]" ], "text/plain": [ "(%o2) 12" ], "text/x-maxima": [ "12" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bar(1,2);" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "to_lisp(); (clj::get-source-map #P\"CELL:616192309.MAC.NEWEST\") (to-maxima)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "to_lisp();" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ ":lisp (print 7)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "error(2);" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "maxima::*stream-alist*" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "break();" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "(remhash #P\"CELL:2115503282.MAC.NEWEST\" clj::*source-maps*)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "(defun wibble (x)\n", " (print x)\n", " (+ x 7))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "(wibble 8)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "(clj::get-source-map #P\"CELL:591804621.MAC.NEWEST\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "(clj::reset-source-map #P\"CELL:4253716536.MAC.NEWEST\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "(defun wibble (x)\n", " (print x)\n", " (+ x 1))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Maxima", "language": "maxima", "name": "maxima" }, "language_info": { "codemirror_mode": "maxima", "file_extension": ".mac", "mimetype": "text/x-maxima", "name": "maxima", "pygments_lexer": "maxima", "version": "5.45.1" } }, "nbformat": 4, "nbformat_minor": 4 }