Permalink
Browse files

Get Andes2 help server to run with newer lisp installation

and some unused cruft removed.  Change uffi -> cffi,
removed unused references to error handler and student profile
file, add forward compatibility for newer problem files
(but not pointers).
  • Loading branch information...
1 parent d7f87e1 commit 5de408c1ce05d428028db12ebc400c9782de9a85 @bvds committed May 24, 2011
Showing with 121 additions and 101 deletions.
  1. +93 −92 Algebra/solver.cl
  2. +0 −1 Help/Andes2-Main.cl
  3. +13 −2 Help/Commands.cl
  4. +0 −3 Help/State.cl
  5. +12 −2 Knowledge/Problem.cl
  6. +2 −1 andes-help.asd
  7. +1 −0 andes.asd
View
185 Algebra/solver.cl
@@ -154,31 +154,31 @@
#+LINUX (defparameter *DLL-NAME* "libSolver.so")
#+DARWIN (defparameter *DLL-NAME* "libSolver.dylib") ;OS X
-#+uffi (defvar force-reload nil) ;flag for reloading after solver-unload
+#+cffi (defvar force-reload nil) ;flag for reloading after solver-unload
(defun solver-load (&optional filename)
(let ((path (if filename filename
(merge-pathnames *DLL-NAME* *Andes-Path*))))
- #-uffi(unless (member *DLL-NAME* (ff:list-all-foreign-libraries)
+ #-cffi(unless (member *DLL-NAME* (ff:list-all-foreign-libraries)
:key #'file-namestring :test #'string-equal))
(format T "~&Loading solver from ~A~%" path)
- #-uffi(load path)
- #+uffi(uffi:load-foreign-library path
+ #-cffi(load path)
+ #+cffi(uffi:load-foreign-library path
;;; The libraries which are needed.
;;; Only needed for Python-based Lisps like CMUCL, SBCL, or SCL?
:supporting-libraries '("c" "m")
:force-load force-reload
)
- #+uffi (setf force-reload nil)
+ #+cffi (setf force-reload nil)
; on load, ensure logging set to Lisp variable value
(solver-logging *solver-logging*)
))
(defun solver-unload ()
(let ((path (merge-pathnames *DLL-NAME* *Andes-Path*)))
;; uffi doesn't have an unload command, so we are stuck with reloading.
- #+uffi (setf force-reload t)
- #-uffi (when (member *DLL-NAME* (ff:list-all-foreign-libraries)
+ #+cffi (setf force-reload t)
+ #-cffi (when (member *DLL-NAME* (ff:list-all-foreign-libraries)
:key #'file-namestring :test #'string-equal)
(format T "~&UnLoading solver from ~A~%" path)
(ff::unload-foreign-library path))))
@@ -196,15 +196,15 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-solve-do-log "solverDoLog")
+#-cffi (ff:def-foreign-call (c-solve-do-log "solverDoLog")
((string (* :char)))
:returning :int) ;BvdS: but it returns a string...
-#+uffi (uffi:def-function ("solverDoLog" c-solve-do-log )
+#+cffi (uffi:def-function ("solverDoLog" c-solve-do-log )
((string :cstring))
:returning :cstring)
-#-uffi (defun solve-do-log (a)
+#-cffi (defun solve-do-log (a)
(excl:native-to-string (c-solve-do-log a)))
-#+uffi (defun solve-do-log (arg)
+#+cffi (defun solve-do-log (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-solve-do-log arg-native))))
@@ -215,103 +215,103 @@
(my-read-answer (solve-do-log (format nil "~A" x))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-solve-start-log "solverStartLog")
+#-cffi (ff:def-foreign-call (c-solve-start-log "solverStartLog")
((string (* :char)))
:returning :int) ;BvdS: but it returns a string...
-#+uffi (uffi:def-function ("solverStartLog" c-solve-start-log)
+#+cffi (uffi:def-function ("solverStartLog" c-solve-start-log)
((string :cstring))
:returning :cstring)
-#-uffi (defun solve-start-log (a)
+#-cffi (defun solve-start-log (a)
(excl:native-to-string (c-solve-start-log a)))
-#+uffi (defun solve-start-log (arg)
+#+cffi (defun solve-start-log (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-solve-start-log arg-native))))
(defun solver-log-new-name (x)
(my-read-answer (solve-start-log (format nil "~A" x))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-solve-debug-level "solverDebugLevel")
+#-cffi (ff:def-foreign-call (c-solve-debug-level "solverDebugLevel")
((level :unsigned-long))
:returning :int) ;BvdS: but it returns a string...
-#+uffi (uffi:def-function ("solverDebugLevel" c-solve-debug-level)
+#+cffi (uffi:def-function ("solverDebugLevel" c-solve-debug-level)
((level :unsigned-long))
:returning :cstring)
-#-uffi (defun solve-debug-level (a)
+#-cffi (defun solve-debug-level (a)
(excl:native-to-string (c-solve-debug-level a)))
-#+uffi (defun solve-debug-level (arg)
+#+cffi (defun solve-debug-level (arg)
(uffi:convert-from-cstring (c-solve-debug-level arg)))
(defun solver-debug-level (x) ;use #x... for hexadecimal format
(my-read-answer (solve-debug-level x)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-solve-bubble "solveBubble")
+#-cffi (ff:def-foreign-call (c-solve-bubble "solveBubble")
(:void)
:returning :int)
-#+uffi (uffi:def-function ("solveBubble" c-solve-bubble)
+#+cffi (uffi:def-function ("solveBubble" c-solve-bubble)
nil
:returning :cstring)
-#-uffi (defun solve-bubble ()
+#-cffi (defun solve-bubble ()
(excl:native-to-string (c-solve-bubble)))
-#+uffi (defun solve-bubble ()
+#+cffi (defun solve-bubble ()
(uffi:convert-from-cstring (c-solve-bubble)))
(defun solver-solve-problem ()
(my-read-answer (solve-bubble)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-solve-more-bubble "solveMoreBubble")
+#-cffi (ff:def-foreign-call (c-solve-more-bubble "solveMoreBubble")
(:void)
:returning :int)
-#+uffi (uffi:def-function ("solveMoreBubble" c-solve-more-bubble)
+#+cffi (uffi:def-function ("solveMoreBubble" c-solve-more-bubble)
nil
:returning :cstring)
-#-uffi (defun solve-more-bubble ()
+#-cffi (defun solve-more-bubble ()
(excl:native-to-string (c-solve-more-bubble)))
-#+uffi (defun solve-more-bubble ()
+#+cffi (defun solve-more-bubble ()
(uffi:convert-from-cstring (c-solve-more-bubble)))
(defun solver-solve-more-problem ()
(my-read-answer (solve-more-bubble)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-solve-add "solveAdd")
+#-cffi (ff:def-foreign-call (c-solve-add "solveAdd")
((string (* :char)))
:returning :int)
-#+uffi (uffi:def-function ("solveAdd" c-solve-add)
+#+cffi (uffi:def-function ("solveAdd" c-solve-add)
((string :cstring))
:returning :cstring)
-#-uffi (defun solve-add (a)
+#-cffi (defun solve-add (a)
(excl:native-to-string (c-solve-add a)))
-#+uffi (defun solve-add (arg)
+#+cffi (defun solve-add (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-solve-add arg-native))))
(defun solver-send-problem-statement (x)
(my-read-answer (solve-add (format nil "~S" x)))) ;format to show keywords
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-solve-clear "solveClear")
+#-cffi (ff:def-foreign-call (c-solve-clear "solveClear")
(:void)
:returning :int)
-#+uffi (uffi:def-function ("solveClear" c-solve-clear)
+#+cffi (uffi:def-function ("solveClear" c-solve-clear)
nil
:returning :cstring)
-#-uffi (defun solve-clear ()
+#-cffi (defun solve-clear ()
(excl:native-to-string (c-solve-clear)))
-#+uffi (defun solve-clear ()
+#+cffi (defun solve-clear ()
(uffi:convert-from-cstring (c-solve-clear)))
(defun solver-new-problem ()
(my-read-answer (solve-clear)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-indy-is-independent "c_indyCanonHowIndy")
+#-cffi (ff:def-foreign-call (c-indy-is-independent "c_indyCanonHowIndy")
((string (* :char)))
:returning :int)
-#+uffi (uffi:def-function ("c_indyCanonHowIndy" c-indy-is-independent)
+#+cffi (uffi:def-function ("c_indyCanonHowIndy" c-indy-is-independent)
((string :cstring))
:returning :cstring)
-#-uffi (defun indy-is-independent (arg)
+#-cffi (defun indy-is-independent (arg)
(excl:native-to-string (c-indy-is-independent arg)))
-#+uffi (defun indy-is-independent (arg)
+#+cffi (defun indy-is-independent (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-indy-is-independent arg-native))))
@@ -320,15 +320,15 @@
(format nil "(~A ~A)" setID equationID))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-indy-add-variable "c_indyAddVariable")
+#-cffi (ff:def-foreign-call (c-indy-add-variable "c_indyAddVariable")
((string (* :char)))
:returning :int)
-#+uffi (uffi:def-function ("c_indyAddVariable" c-indy-add-variable)
+#+cffi (uffi:def-function ("c_indyAddVariable" c-indy-add-variable)
((string :cstring))
:returning :cstring)
-#-uffi (defun indy-add-variable (arg)
+#-cffi (defun indy-add-variable (arg)
(excl:native-to-string (c-indy-add-variable arg)))
-#+uffi (defun indy-add-variable (arg)
+#+cffi (defun indy-add-variable (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-indy-add-variable arg-native))))
@@ -339,29 +339,29 @@
(write-to-string arg :pretty NIL :escape NIL))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-indy-done-add-variable "c_indyDoneAddVariable")
+#-cffi (ff:def-foreign-call (c-indy-done-add-variable "c_indyDoneAddVariable")
(:void)
:returning :int)
-#+uffi (uffi:def-function ("c_indyDoneAddVariable" c-indy-done-add-variable)
+#+cffi (uffi:def-function ("c_indyDoneAddVariable" c-indy-done-add-variable)
nil
:returning :cstring)
-#-uffi (defun indy-done-add-variable ()
+#-cffi (defun indy-done-add-variable ()
(excl:native-to-string (c-indy-done-add-variable)))
-#+uffi (defun indy-done-add-variable ()
+#+cffi (defun indy-done-add-variable ()
(uffi:convert-from-cstring (c-indy-done-add-variable)))
(defun solver-indyDoneAddVar ()
(my-read-answer (indy-done-add-variable)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-indy-add-equation "c_indyAddEquation")
+#-cffi (ff:def-foreign-call (c-indy-add-equation "c_indyAddEquation")
((string (* :char)))
:returning :int)
-#+uffi (uffi:def-function ("c_indyAddEquation" c-indy-add-equation)
+#+cffi (uffi:def-function ("c_indyAddEquation" c-indy-add-equation)
((string :cstring))
:returning :cstring)
-#-uffi (defun indy-add-equation (arg)
+#-cffi (defun indy-add-equation (arg)
(excl:native-to-string (c-indy-add-equation arg)))
-#+uffi (defun indy-add-equation (arg)
+#+cffi (defun indy-add-equation (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-indy-add-equation arg-native))))
@@ -370,29 +370,29 @@
(format nil "(~A ~S)" equationID equation))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-indy-empty "c_indyEmpty")
+#-cffi (ff:def-foreign-call (c-indy-empty "c_indyEmpty")
(:void)
:returning :int)
-#+uffi (uffi:def-function ("c_indyEmpty" c-indy-empty)
+#+cffi (uffi:def-function ("c_indyEmpty" c-indy-empty)
nil
:returning :cstring)
-#-uffi (defun indy-empty ()
+#-cffi (defun indy-empty ()
(excl:native-to-string (c-indy-empty)))
-#+uffi (defun indy-empty ()
+#+cffi (defun indy-empty ()
(uffi:convert-from-cstring (c-indy-empty)))
(defun solver-indyEmpty ()
(my-read-answer (indy-empty)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-indy-add-eq-to-set "c_indyAddEq2Set")
+#-cffi (ff:def-foreign-call (c-indy-add-eq-to-set "c_indyAddEq2Set")
((string (* :char)))
:returning :int)
-#+uffi (uffi:def-function ("c_indyAddEq2Set" c-indy-add-eq-to-set)
+#+cffi (uffi:def-function ("c_indyAddEq2Set" c-indy-add-eq-to-set)
((string :cstring))
:returning :cstring)
-#-uffi (defun indy-add-eq-to-set (arg)
+#-cffi (defun indy-add-eq-to-set (arg)
(excl:native-to-string (c-indy-add-eq-to-set arg)))
-#+uffi (defun indy-add-eq-to-set (arg)
+#+cffi (defun indy-add-eq-to-set (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-indy-add-eq-to-set arg-native))))
@@ -401,15 +401,15 @@
(format nil "(~A ~A)" setID equationID))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-indy-keep-n-of-set "c_indyKeepNOfSet")
+#-cffi (ff:def-foreign-call (c-indy-keep-n-of-set "c_indyKeepNOfSet")
((string (* :char)))
:returning :int)
-#+uffi (uffi:def-function ("c_indyKeepNOfSet" c-indy-keep-n-of-set)
+#+cffi (uffi:def-function ("c_indyKeepNOfSet" c-indy-keep-n-of-set)
((string :cstring))
:returning :cstring)
-#-uffi (defun indy-keep-n-of-set (arg)
+#-cffi (defun indy-keep-n-of-set (arg)
(excl:native-to-string (c-indy-keep-n-of-set arg)))
-#+uffi (defun indy-keep-n-of-set (arg)
+#+cffi (defun indy-keep-n-of-set (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-indy-keep-n-of-set arg-native))))
@@ -418,15 +418,15 @@
(format nil "(~A ~A)" setID numberToKeep))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-student-is-independent "c_indyStudHowIndy")
+#-cffi (ff:def-foreign-call (c-student-is-independent "c_indyStudHowIndy")
((string (* :char)))
:returning :int)
-#+uffi (uffi:def-function ("c_indyStudHowIndy" c-student-is-independent)
+#+cffi (uffi:def-function ("c_indyStudHowIndy" c-student-is-independent)
((string :cstring))
:returning :cstring)
-#-uffi (defun student-is-independent (arg)
+#-cffi (defun student-is-independent (arg)
(excl:native-to-string (c-student-is-independent arg)))
-#+uffi (defun student-is-independent (arg)
+#+cffi (defun student-is-independent (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-student-is-independent arg-native))))
@@ -435,15 +435,15 @@
(format nil "(~A ~A)" setID equationID))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-student-is-add-okay "c_indyStudentAddEquationOkay")
+#-cffi (ff:def-foreign-call (c-student-is-add-okay "c_indyStudentAddEquationOkay")
((string (* :char)))
:returning :int)
-#+uffi (uffi:def-function ("c_indyStudentAddEquationOkay" c-student-is-add-okay)
+#+cffi (uffi:def-function ("c_indyStudentAddEquationOkay" c-student-is-add-okay)
((string :cstring))
:returning :cstring)
-#-uffi (defun student-is-add-okay (arg)
+#-cffi (defun student-is-add-okay (arg)
(excl:native-to-string (c-student-is-add-okay arg)))
-#+uffi (defun student-is-add-okay (arg)
+#+cffi (defun student-is-add-okay (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-student-is-add-okay arg-native))))
@@ -454,31 +454,32 @@
(solver-studentAddOkay slot "")) ;result should = 8
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-student-is-okay "c_indyIsStudentEquationOkay")
+#-cffi (ff:def-foreign-call (c-student-is-okay "c_indyIsStudentEquationOkay")
((string (* :char)))
:returning :int)
-#+uffi (uffi:def-function ("c_indyIsStudentEquationOkay" c-student-is-okay)
+#+cffi (uffi:def-function ("c_indyIsStudentEquationOkay" c-student-is-okay)
((string :cstring))
:returning :cstring)
-#-uffi (defun student-is-okay (arg)
+#-cffi (defun student-is-okay (arg)
(excl:native-to-string (c-student-is-okay arg)))
-#+uffi (defun student-is-okay (arg)
+#+cffi (defun student-is-okay (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-student-is-okay arg-native))))
(defun solver-studentIsOkay (equation)
(my-read-answer (student-is-okay (format nil "(~A)" equation))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-sub-in-one-eqn "c_subInOneEqn")
+#-cffi (ff:def-foreign-call (c-sub-in-one-eqn "c_subInOneEqn")
((string (* :char)))
:returning :int)
-#+uffi (uffi:def-function ("c_subInOneEqn" c-sub-in-one-eqn)
+#+cffi (uffi:def-function ("c_subInOneEqn" c-sub-in-one-eqn)
((string :cstring))
:returning :cstring)
-#-uffi (defun sub-in-one-eqn (arg)
- (excl:native-to-string (c-sub-in-one-eqn arg)))
-#+uffi (defun sub-in-one-eqn (arg)
+#-cffi (defun sub-in-one-eqn (arg)
+ (excl:nat
+ive-to-string (c-sub-in-one-eqn arg)))
+#+cffi (defun sub-in-one-eqn (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-sub-in-one-eqn arg-native))))
@@ -487,15 +488,15 @@
(format nil "(~A ~A ~A)" assignmentID eqnID destID))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-solve-power-solve "c_powersolve")
+#-cffi (ff:def-foreign-call (c-solve-power-solve "c_powersolve")
((string (* :char)))
:returning :int)
-#+uffi (uffi:def-function ("c_powersolve" c-solve-power-solve)
+#+cffi (uffi:def-function ("c_powersolve" c-solve-power-solve)
((string :cstring))
:returning :cstring)
-#-uffi (defun solve-power-solve (arg)
+#-cffi (defun solve-power-solve (arg)
(excl:native-to-string (c-solve-power-solve arg)))
-#+uffi (defun solve-power-solve (arg)
+#+cffi (defun solve-power-solve (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-solve-power-solve arg-native))))
@@ -504,15 +505,15 @@
(format nil "(~A ~A ~A)" strength varName slot))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-solve-one-eqn "c_solveOneEqn")
+#-cffi (ff:def-foreign-call (c-solve-one-eqn "c_solveOneEqn")
((string (* :char)))
:returning :int)
-#+uffi (uffi:def-function ("c_solveOneEqn" c-solve-one-eqn)
+#+cffi (uffi:def-function ("c_solveOneEqn" c-solve-one-eqn)
((string :cstring))
:returning :cstring)
-#-uffi (defun solve-one-eqn (arg)
+#-cffi (defun solve-one-eqn (arg)
(excl:native-to-string (c-solve-one-eqn arg)))
-#+uffi (defun solve-one-eqn (arg)
+#+cffi (defun solve-one-eqn (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-solve-one-eqn arg-native))))
@@ -521,15 +522,15 @@
(format nil "(~A ~A ~A)" name equationSlot destinationSlot))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-#-uffi (ff:def-foreign-call (c-simplify-eqn "c_simplifyEqn")
+#-cffi (ff:def-foreign-call (c-simplify-eqn "c_simplifyEqn")
((string (* :char)))
:returning :int)
-#+uffi (uffi:def-function ("c_simplifyEqn" c-simplify-eqn)
+#+cffi (uffi:def-function ("c_simplifyEqn" c-simplify-eqn)
((string :cstring))
:returning :cstring)
-#-uffi (defun simplify-eqn (arg)
+#-cffi (defun simplify-eqn (arg)
(excl:native-to-string (c-simplify-eqn arg)))
-#+uffi (defun simplify-eqn (arg)
+#+cffi (defun simplify-eqn (arg)
(check-type arg string)
(uffi:with-cstring (arg-native arg)
(uffi:convert-from-cstring (c-simplify-eqn arg-native))))
View
1 Help/Andes2-Main.cl
@@ -530,7 +530,6 @@ setsockopt SO_REUSEADDR if :reuse is not nil"
(solver-load)
(solver-logging *solver-logging*)
(physics-algebra-rules-initialize) ;initialize grammar
- (enable-errors)
)
(defun andes-stop ()
View
15 Help/Commands.cl
@@ -1067,10 +1067,21 @@
;; Note "get" on unset values return NIL.
;;
(defun history-get (key)
- (studentfile-ask key))
+ ;; (studentfile-ask key)
+)
(defun history-set (key value)
- (studentfile-tell key value))
+ ;; (studentfile-tell key value)
+)
+
+(defvar *errors-on* nil
+ "If t then errors are sent to *error-stream* else are ignored.")
+
+(defun error-message (message)
+ (if *errors-on*
+ (if (stringp message)
+ (format t "(Error: ~A)~%" message)
+ (format t "(Error: ~A)~%" message))))
View
3 Help/State.cl
@@ -228,9 +228,6 @@
;; continue, perhaps without student information, so don't let Lisp errors
;; propagate out of this routine. !!! Might want to communicate warning
;; message in case of failure to load student file, though.
-
- ;; Don't fail call if fail to load student file.
- (safe-apply 'StudentFile-load (list name))
;; we want to load the config file after student name is known, so it can
;; include customizations based on student name (used in some experiments).
View
14 Knowledge/Problem.cl
@@ -118,6 +118,7 @@
Solutions ;Set of solution bubbles. The first will always be
;the best. (list of Eqnset)
wm ;; Collection of the solver working memory.
+
)
;;-----------------------------------------------------------------------------
@@ -346,7 +347,13 @@
(read-mreadable-EqnSets Stream (Problem-EqnIndex Problem) (Problem-Graph Problem)
(problem-version Problem))))
- (t (error "Undefined Problem-header tag. ~A" name))))
+ ;; New version may have other tags.
+ (Fade (mpf-readret Stream))
+ (Keywords (mpf-readret Stream))
+ (Phrases (mpf-readret Stream))
+
+ ;; Don't try to read pointers.
+ (t (error "Unknown Problem-header tag. ~A" name))))
@@ -401,7 +408,10 @@
(ModDate nil) (Version *latest-file-version*)
(ForbiddenPSMS nil) (IgnorePSMS nil)
(VariableMarks Nil) (Times nil)
- (Choices nil) (Graphic nil) (Predefs nil))
+ (Choices nil) (Graphic nil) (Predefs nil)
+ ;; For forward compatibility with Andes3 problem definitions
+ fade english
+ )
"Define a problem struct and store it."
(let ((Prob (eval `(make-problem :Name ',name ;;Define the problem struct.
:soughts ',(remove-answer
View
3 andes-help.asd
@@ -67,7 +67,8 @@
(:file "parse-andes"
:depends-on ("SolutionGraph"))
(:file "interpret-equation"
- :depends-on ("SolutionGraph"))
+ :depends-on ("SolutionGraph")
+ :depends-on ("HelpMessages"))
;; Help
(:file "HelpMessages")
View
1 andes.asd
@@ -27,6 +27,7 @@
(defsystem :andes
:name "Andes"
+ :depends-on (cffi-uffi-compat)
:description "Andes physics tutor system"
:components (
;;; this should eventually be removed

0 comments on commit 5de408c

Please sign in to comment.