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|-nonag)
@@ -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