From: Stavros M. <mac...@al...> - 2022-09-04 23:24:13
|
For the distinction between evaluation and simplification, see the relevant manual section <https://maxima.sourceforge.io/docs/manual/maxima_45.html>. Basically a *routine *(or evaluating function) *does* something, but a simplifying function *means* something. Attached please find a simple Lisp file which defines *twenty* as a routine that returns the number 20, and *thirty *as a simplifying function that returns 30. Now look at how they behave differently: load(".../rout-simp.lisp") <<< where ... is the pathname where you put this file twenty() => 20 thirty() => 30 So far, they behave similarly. Now let's prevent evaluation by putting them in quotes *'(...)*: '(twenty()) => twenty() '(thirty()) => 30 <<< simplification happened in the absence of evaluation And now let's turn off simplification: simp:false$ <<< This breaks most of Maxima, which depends on simplification ubiquitously twenty() => 20 <<< evaluation in the absence of simplification thirty() => thirty() <<< no simplification simp:true$ << restore universe to a sane state And sure enough, Maxima doesn't autoload simplifying functions (maybe it should). I'm not quite sure why it works the *second* time with *%solve*, though.... -s On Sun, Sep 4, 2022 at 3:54 PM Oleg Nesterov <ol...@re...> wrote: > On 09/04, Stavros Macrakis wrote: > > > > My guess -- I haven't investigated -- is that this is because %solve is a > > simplifying function, not a subroutine. > > Thanks... please forgive my ignorance, could you explain what does > "simplifying > function" mean? > > looks like, autoload doesn't work because %solve is the alias. Please see > the > trivial test-case: > > $ cat /tmp/test.mac > f(x) := x + 1; > > alias(g, f); > > $ maxima -q > (%i1) setup_autoload("/tmp/test.mac", g); > (%o1) done > (%i2) g(0); > (%o2) g(0) > (%i3) g(0); > (%o3) 1 > > Oleg. > > |