On Tue, Jun 27, 2023 at 07:34:03AM +0200, Ralf Hemmecke wrote:
> > AFACS in Boot this is:
> > 
> > interpret_block(code) ==
> >      $newcompErrorCount : local := 0
> >      $inclAssertions : local := []
> >      $ncMsgList : local := []
> >      $erMsgToss : local := false
> >      $lastPos : local := $nopos
> >      $EchoLines : local := false
> >      st := MAKE_-STRING_-INPUT_-STREAM(code)
> >      intloopInclude0(st, 'webspad, 0)
> 
> Thank you! I will test tonight.
> 
> > Both Lisp version and the above behave rather badly when called
> > from command line (the same is true for parseAndEvalStr).
> > Namely, after calling it interpreter is apparently waiting
> > for more input from the string, but none is coming.  So
> > command line is effectively blocked.  Probably does not
> > matter for server style use, but definitely it is not "universal"
> > function.
> 
> Maybe I do not quite get what you say. Is it: "The function works nicely,
> but the user cannot send another string during the time the first call to
> interpret_block is running?" In other words I cannot have two instances of
> interpret_block running at the same time?
> I wonder how this could be ever relevant when FriCAS anyway uses just one
> processor.

To explain more: interpret_block gets simple input and should do its
work in almost no time, but apparently it never finishes.  I must
admit that natural question is how it can work at all in
webspad?  I did not look but probably some of extra variable
setting causes it to finish.

BTW: To see what I mean try

s := "1 + 1"
interpret_block(s)$Lisp

I can issue new commands only after pressing Ctrl-C.
And adding newline at end of the string does not help.

> Although it would be an interesting idea to send and evaluate other input to
> FriCAS during a long running command, but wouldn't that badly interfere with
> session management? When the first command does something like "z:=1; for i
> in 1..10^100 repeat print(i)" and the second one says "z:=2", would the
> first one suddenly print 2?

Not a problem at all.  Effectively this is done when you run
Hyperdoc examples.  Of course, when one command source has long
computation the second must wait.  User variables are handled by
frame machinery.  Of course,  if code in two frames tried to set
global Boot variable to different value (possibly via ')set'
command) there would be trouble.

-- 
                              Waldek Hebisch

-- 
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/ZJrRAXE7TRZfZgl0%40fricas.math.uni.wroc.pl.

Reply via email to