Hi Waldek,

during our work on jfricas, we first had a version that needed the
filesystem in order to interpret a Jupyter cell with multiline FriCAS
input. Code was first written to a temporary .input file and then read
back for interpretation.

The problem was where to save that temporary file until I realized that
one can easily tweak the )read routine and give it the lines from memory
instead of reading it from the filesystem. The result is the function
"interpret-block" in webspad.lisp.

https://github.com/fricas/jfricas/blob/master/jfricas/webspad.lisp#L101
(attached below)

I think that function should rather live inside FriCAS itself (chose a
name that you like).

For my day-to-day work I use the axiom-environment of Paul Onions.
https://bitbucket.org/pdo/axiom-environment/src/master/
I guess that Frontend would also benefit from that function.

What do you think? Should a prepare a pull-request?

Ralf

=============================================================

;;; interpret-block takes a code string that is interpreted as if it
;;; comes from a .input file.
(DEFUN |interpret-block| (|code|)
  (PROG (|$ncMsgList| |$erMsgToss| |$lastPos| |$EchoLines| |st|)
    (DECLARE (SPECIAL |$ncMsgList| |$erMsgToss| |$lastPos| |$EchoLines|))
    (RETURN
     (PROGN
      (SETQ |$EchoLines| NIL)
      (SETQ |$lastPos| |$nopos|)
      (SETQ |$erMsgToss| NIL)
      (SETQ |$ncMsgList| NIL)
      (SETQ |st| (MAKE-STRING-INPUT-STREAM |code|))
      (|intloopInclude0| |st| '|webspad| 0)))))

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/d5a88a2d-3f07-4fe6-bc05-59b83fc8e0c8%40hemmecke.org.

Reply via email to