Ok, now I've realized the problem sources.

1. otheropts="-eval $1" must be changed to otheropts="-eval \"$1\"".
That will be anough to make axiom -eval "some code" -nosman workable
even with having spaces string.
2. There is already mechanism in sman.c to pass parameters to AXIOMsys
avoiding them to be captured by Lisp interpreter. So the fix is to put
"-eval" after "--" in sman.c . I could do it myself, but I am on a
little vacation now where internet connection is very slow. So I'll be
able to fix that only at the next weekend.

On Jan 14, 6:15 am, "Andrey G. Grozin" <[email protected]> wrote:
> On Tue, 11 Jan 2011, Waldek Hebisch wrote:
> > 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
>
> This is a patch for the fricas script to use this mechanism. It allows one
> to have several -eval parameters.
>
> ================================
> --- /usr/bin/fricas     2010-11-24 06:40:41.000000000 +0600
> +++ fricas      2011-01-14 19:55:11.000000000 +0600
> @@ -20,2 +20,3 @@
>   #      [-list]                    list workspaces only
> +#      [-eval command]      evaluate command before the session
>   #      [-grprog fname]            use named program for Graphics
> @@ -63,2 +64,3 @@
>   echo "     [-list]              list workspaces only"
> +echo "     [-eval command]      evaluate command before the session"
>   #echo "     [-grprog fname]      use named program for Graphics"
> @@ -138,2 +140,3 @@
>   otheropts=""
> +FRICAS_EVAL=""
>
> @@ -164,2 +167,14 @@
>                 ;;
> +
> +        -eval)
> +               if [ "$2" = "" ] ; then needsubopt "$1" ; fi
> +                if [ "$FRICAS_EVAL" = "" ] ; then
> +                    FRICAS_EVAL="$2"
> +                else
> +                    FRICAS_EVAL="$FRICAS_EVAL
> +$2"
> +                fi
> +                shift
> +                ;;
> +
>         
> -clef|-noclef|-gr|-nogr|-ht|-noht|-iw|-noiw|-ihere|-noihere|-nox|-nag|-nona g)
> @@ -215,2 +230,6 @@
>   fi
> +
> +if [ "$FRICAS_EVAL" != "" ] ; then
> +        export FRICAS_EVAL
> +fi
>
> ================================
>
> Andrey

-- 
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