From: David B. <dbm...@gm...> - 2023-07-17 06:41:43
|
fapply a new (2023-05-13) macro in mopers.lisp. It is probably in the 5.47.0 release, but I can't check right now. See https://sourceforge.net/p/maxima/code/ci/master/tree/src/mopers.lisp ;; Apply a function f to a list of its arguments 'args' and simplify the result. Assume ;; that the list args is simplified. (defmacro fapply (f args) `(simplifya (cons (list ,f) ,args) t)) On 17/07/2023 15:24, Eduardo Ochs wrote: > Hi Barton! > That's super neat!!! =) > But I don't have fapply here... can you send your definition? > Here's a version that works, but in which the fapply was > (re)constructed by guesswork: > > to_lisp()$ > > (defun fapply (op lst) `((,op simp) ,@lst)) > > (defun $defmspec_list () > (let ((lst nil)) > (do-symbols (s (find-package "MAXIMA")) > (when (get s 'mfexpr*) > (push s lst))) > (fapply 'mlist lst))) > > (to-maxima) > > defmspec_list(); > sort(defmspec_list()); > > Cheers, thanks, etc =), > Eduardo > > > On Sun, 16 Jul 2023 at 21:03, Barton Willis <wi...@un...> wrote: > > I don't do things like this all that much, but you might be able > to do something like this: > > (defun$defmspec_list () > (let ((lst nil)) > (do-symbols (s (find-package"MAXIMA")) > (when (get s 'mfexpr*) > (push s lst))) > (fapply 'mlist lst))) > > This only looks at functions in Maxima's core. > > (%i8) sort(defmspec_list()); > > (%o8) [@,alias,apply1,apply2,applyb1,applyb2,apropos,array,arrayinfo,assume,buildq,catch,cf,compfile,compile, > create_list,declare,declare_index_properties,declare_translated,define,define_variable,defmatch,defrule,defstruct,deftaylor > ,dependencies,describe,dispfun,display,disprule,errcatch,ev,eval_when,example,forget,fortran,fullmap,fullmapl,fundef, > gauss,gradef,grind,interpolate,is,kill,ldisplay,let,letrules,letsimp,loadfile,local,lsum,macroexpand,macroexpand1, > makelist,makeset,map,maplist,matchdeclare,matrixmap,maybe,mode_identity,mode_declare,new,numerval,ordergreat, > orderless,playback,pop,printprops,product,properties,propvars,push,qput,rearray,remarray,remfunction,remlet,remove, > remove_index_properties,remvalue,reset,reset_verbosely,save,scanmap,status,string,stringout,substinpart,substpart, > subvar,sum,tellsimp,tellsimpafter,tex,time,timer,timer_info,trace,trace_options,translate,untimer,untrace, > with_default_2d_display,with_slider,with_slider_draw,with_slider_draw2d,with_slider_draw3d,with_stdout,wxanimate, > wxanimate_draw,wxanimate_draw3d,wxdraw_list,bigfloat,lambda,and,mcond,:=,::=,mdo,mdoin,go,mlocal, > mmacroexpanded,not,or,mpois,block,mprogn,',mrat,:,quote] > > --Barton > > ------------------------------------------------------------------------ > *From:* Eduardo Ochs <edu...@gm...> > Sent: Saturday, July 15, 2023 23:09 > *To:* Robert Dodier <rob...@gm...>; Jeronimo Pellegrini > <j_...@al...> > *Cc:* <max...@li...> > <max...@li...> > *Subject:* Re: [Maxima-discuss] :lisp (describe '$tex) > Non-NU Email > ------------------------------------------------------------------------ > On Sat, 15 Jul 2023 at 21:36, Robert Dodier > <rob...@gm...> wrote: > > Hi Eduardo, > > For the record, Maxima functions defined by DEFMSPEC are so-called > argument quoting functions; these functions work either with > unevaluated symbols (e.g. kill), or manage evaluation by explicit > calls to MEVAL (e.g. makelist) -- this latter approach leads > to more > or less unpredictable evaluation behavior. I think the best we > can do > is to document any such existing functions, and be very > circumspect > about introducing new ones. > > Hope this helps, > > Robert > > > Hi Jeronimo and Robert, > > I grepped the sources and (I think that I) found 153 Maxima functions > that are defined using defmspec... it would be good to have a nice way > to jump to their sources, but I confess that I would be happy with a > non-nice way, too. I just found that if I run this, > > to_lisp()$ > (describe '$changevar) > (describe '$tex) > (symbol-plist '$tex) > (get '$tex 'mfexpr*) > (to-maxima) > > the output of the "(get '$tex 'mfexpr*)" is: > > #<FUNCTION (LAMBDA (L) :IN > "/home/edrx/bigsrc/maxima/src/mactex.lisp") {52FB567B}> > > how do I extract the "/home/edrx/bigsrc/maxima/src/mactex.lisp" from > that? > > Thanks in advance =P, > Eduardo Ochs > > > > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss |