From: Eduardo O. <edu...@gm...> - 2022-01-11 02:58:47
|
Hi list, I am trying - first - to understand the difference between these ways of defining functions, f : x^2; g(x) := x^3; h(x) ::= x^4; both from a user's points of view and from a common lisper's point of view, and - second - I'm looking for some references on how people decided to implement things in this way... let me explain. First: what are your favorite ways to show how the innards of Maxima see the "f", the "g(x)", and the "h(x)" above? I executed this, f : x^2; g(x) := x^3; h(x) ::= x^4; f; g; g(x); g(y); dispfun(g); dispfun(h); :lisp #$[f]$ :lisp #$[F]$ :lisp #$[g]$ :lisp #$[g(x)]$ :lisp #$[g(y+z)]$ :lisp (displa #$[g(y+z)]$) :lisp '((MLIST SIMP) ((MEXPT SIMP) ((MPLUS SIMP) $Y $Z) 3)) :lisp (displa '((MLIST SIMP) ((MEXPT SIMP) ((MPLUS SIMP) $Y $Z) 3))) :lisp $functions :lisp (cdr $functions) :lisp (dispfun1 (cdr $functions) t nil) :lisp $macros :lisp (cdr $macros) :lisp (dispfun1 (cdr $macros) t nil) I haven't progressed much beyond this point yet... for example, I still don't know where f is stored, and I am trying to understand the "(defmspec $dispfun ...)" and the "(defun dispfun1 ...)" in src/mlisp.lisp, but my attempts to run parts of their code in "(let (...) ...)" inside the Lisp REPL, i.e., inside a "to_lisp();" / "(to-maxima)" block in the Maxima REPL, are not working - and I don't even know why first line below works but the second one doesn't: dispfun(g); :lisp #$[dispfun(g)]# So I'm a beginner asking questions that may look too advanced... sorry! By the way, my favorite style for explaining these inner details _in Emacs Lisp_ is with tutorials like this one, http://angg.twu.net/eev-intros/find-elisp-intro.html#6 in which I expect people to execute lots of sexps in different orders, and understand their results. Now the second question. This one is more open-ended, and any pointer to references and/or to keywords to search for are more than welcome. I teach Calculus 2 and 3 in a small university in Brazil - or, more precisely, in a small countryside campus that is part of a big university whose main campus is 300 Km away - and I started an experiment a few semesters ago. Instead of teaching the students only the modern notational conventions, in which in g(x) := x^3; the name "x" is always totally irrelevant and can be replaced by any other name, I am trying to teach them both the "old" convention and the "new" one, and I trying to show how to translate between the two, even though I don't know all the rules of the translation... The "old" convention can be seen for example here, Silvanus P. Thompson - "Calculus Made Easy" (1914) - p.14: https://www.gutenberg.org/files/33283/33283-pdf.pdf#page=25 and the "new" convention is the one that says that variables and functions must have different names, all arguments should be explicit, there is no such thing as a "dependent variable", and so on. I call the "old" convention "physicists' notation" and the "new" one the "mathematicians' notation", always between quotes, and I always explain to the students that my attempts to formalize the translation are totally improvised, and that I've asked my friends who work in EDPs or in Mathematical Physics where I can find formalizations of the translation and they simply don't know... So: Maxima has some support for dependent variables - see "? depends" - and I _guess_ that as Maxima is quite old some of its old papers may contain discussions on how people were trying to implement both the "mathematicians' notation" and the "physicists' notation" on Computer Algebra Systems, and how they reached the implementation that Maxima still uses today... I took a look here, http://ftp.math.utah.edu/pub/tex/bib/macsyma.html but that list is huge, it has very few links to online versions, and most of them are broken, and none of the titles mention dependent variables explicitly... Thanks in advance!!! Eduardo Ochs http://angg.twu.net/eev-maxima.html P.S.: for the sake of completeness, my material on the "physicists' notation" is here - http://angg.twu.net/LATEX/2021-2-C3-notacao-de-fisicos.pdf - but it is messy and in Portuguese... |