Finally, I've implemented full support of eval in CL arguments. You
may find it here http://github.com/mbait/fricas/tree/arg_values Just
build and try "axiom -eval ")set" -nosman". However, one issue still
remains - at least sbcl doesn't allow to pass a string with spaces, it
splits the string onto separate args. I don't know whether this is the
same for all Lisp-s.

On Wed, Jan 12, 2011 at 10:27 AM, Alexander Solovets
<[email protected]> wrote:
> I'd wirte "--eval" argument extraction too if I knew how to process
> lists in Boot in terms of Lisp (car and cdr). Also, please, notice
> that the various Lisp dialects may return CL list both with 0th
> argument and without it, so extraction function should take that into
> account.
>
> On Wed, Jan 12, 2011 at 10:20 AM, Alexander Solovets
> <[email protected]> wrote:
>> Here is the patch providing access to command-line arguments for
>> various Lisp-s(excluding poplog)
>> https://github.com/mbait/fricas/commit/488721e72aa495103cfc09475a0e4a706ef682ac
>>
>> On Wed, Jan 12, 2011 at 3:52 AM, Waldek Hebisch
>> <[email protected]> wrote:
>>> Andrey G. Grozin wrote:
>>>>
>>>> On Mon, 10 Jan 2011, Waldek Hebisch wrote:
>>>> > Yes, that is useful.  I think that 'pre' is too unspecific, what
>>>> > about 'FRICAS_PREINIT' and '--preinit'?  Also I similar way we can
>>>> > add 'FRICAS_EVAL_LISP' and '--eval-lisp' to evaluate arbitrary
>>>> > piece of Lisp code.  And maybe 'FRICAS_EVAL' and '--eval' for
>>>> > interpreter input.  The execution order would be Lisp, then
>>>> > preinit then eval.
>>>> It seems that --eval provides all the necessary functionality.
>>>> --eval ')lisp (lisp-code)'
>>>> --eval ')read something.input'
>>>> The file something.input can contain )lisp lines
>>>> All possibilities are covered.
>>>>
>>>> This should be evaluated after .fricas.input but before an interactive
>>>> session, so that something.input could adjust things from .fricas.input
>>>> for the purpose of the present session (for example, a session from
>>>> TeXmacs or from emacs).
>>>>
>>>
>>> The following (minimally tested) patch implements 'FRICAS_EVAL' in
>>> AXIOMsys:
>>>
>>>
>>> Index: src/interp/int-top.boot
>>> ===================================================================
>>> --- src/interp/int-top.boot     (revision 972)
>>> +++ src/interp/int-top.boot     (working copy)
>>> @@ -93,11 +93,17 @@
>>>  $ncmMacro :=            NIL
>>>  $ncmPhase :=      NIL
>>>
>>> +do_pre_eval() ==
>>> +    ec := getEnv('"FRICAS__EVAL")
>>> +    if ec then
>>> +        CATCH('SPAD__READER, CATCH('top__level, parseAndEvalStr ec))
>>> +
>>>  spad() ==
>>>   -- starts the interpreter, read in profiles, etc.
>>>   $PrintCompilerMessageIfTrue: local
>>>   setOutputAlgebra "%initialize%"
>>>   readSpadProfileIfThere()
>>> +  do_pre_eval()
>>>   runspad()
>>>   'EndOfSpad
>>>
>>>
>>> --
>>>                              Waldek Hebisch
>>> [email protected]
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "FriCAS - computer algebra system" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to 
>>> [email protected].
>>> For more options, visit this group at 
>>> http://groups.google.com/group/fricas-devel?hl=en.
>>>
>>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to