>
> Here
>
> https://www.mail-archive.com/[email protected]/msg08035.html
>
> you have suggested
>
> spadThrow() ==
> if $interpOnly and $mapName then
> putHist($mapName,'localModemap, nil, $e)
> $BreakMode = 'throw_reader => throw_to_reader()
> handleLispBreakLoop($BreakMode)
>
> are you going to commit this? (Before or after the release is not
> important to me, but I couldn't find "throw_to_reader()", so I cannot
> experiment with it.
My current patch is in the attachement. It still requires some
work. Namely, when executing .input files we want execution to
respect break mode setting. But in other context we want different
handling. So some experimantation is needed to find out
which behaviour is desirable.
>
> In fact, it would also be nice, if at the same time you rewrite
>
> spad_syntax_error(wanted, parsing) ==
> FORMAT(true, '"******** Spad syntax error detected ********")
> if wanted then
> FORMAT(true, '"~&Expected: ~S~%", wanted)
> if $prev_line then
> FORMAT(true, '"~&The prior line was:~%~%~5D> ~A~%~%",
> $prev_line_number, $prev_line)
> if $curent_line then
> FORMAT(true, '"~&The current line is:~%~%~5D> ~A~%~%",
> $curent_line_number, $curent_line)
> TOKEN_-STACK_-SHOW()
> THROW('SPAD_READER, nil)
>
> to include handleLispBreakMode. I guess I would simply have to replace
> the last line by
>
> $BreakMode = 'throw_reader => throw_to_reader()
> handleLispBreakLoop($BreakMode)
Well, I think that errors in Spad programs should not go via
break mode handling: break mode is designed to allow debugging
interpreter/library. When Spad compiler discovers error in
user program breaking into debugger make little sense.
> PS: Any chance that we change to git (probably after the release), so
> that you can also publish ongoing not-ready-for-prime-time code in a
> branch so that everyone who is interested can follow what you are doing?
Changing to git and publishing ongoing not-ready-for-prime-time code
have no relation: I do _not_ develop new code on branches and it
happens frequently that my working code would not bootstrap.
As I wrote I just compile affected files -- only when code
works I make sure that it fits into build process.
Also not-ready-for-prime-time code oscilates between completely
broken and "almost working". There is extra effort needed to
capture reasonable snapshot -- I do it only when I feel that there
is some interest to try this code.
--
Waldek Hebisch
[email protected]
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Index: src/interp/i-syscmd.boot
===================================================================
--- src/interp/i-syscmd.boot (revision 1881)
+++ src/interp/i-syscmd.boot (working copy)
@@ -152,9 +152,8 @@
terminateSystemCommand() ==
FRESH_-LINE()
TOK := 'END_UNIT
- spadThrow()
+ throw_to_reader()
-
commandUserLevelError(x,u) == userLevelErrorMessage("command",x,u)
optionUserLevelError(x,u) == userLevelErrorMessage("option",x,u)
@@ -2994,4 +2993,5 @@
pf2Sex macroExpanded first rest first s
ncParseFromString(s) ==
+ $BreakMode : local := 'throw_reader
zeroOneTran(packageTran(CATCH('SPAD_READER, parseFromString(s))))
Index: src/interp/g-util.boot
===================================================================
--- src/interp/g-util.boot (revision 1881)
+++ src/interp/g-util.boot (working copy)
@@ -254,10 +254,13 @@
--% Throwing with glorious highlighting (maybe)
+throw_to_reader() == THROW('SPAD_READER, nil)
+
spadThrow() ==
if $interpOnly and $mapName then
putHist($mapName,'localModemap, nil, $e)
- THROW("SPAD_READER", nil)
+ $BreakMode = 'throw_reader => throw_to_reader()
+ handleLispBreakLoop($BreakMode)
spadThrowBrightly x ==
sayBrightly x
Index: src/interp/g-error.boot
===================================================================
--- src/interp/g-error.boot (revision 1881)
+++ src/interp/g-error.boot (working copy)
@@ -127,6 +127,7 @@
THROW('SPAD_READER, nil)
$BreakMode = 'resume =>
returnToReader()
+ $BreakMode = 'throw_reader => THROW('SPAD_READER, nil)
$BreakMode = 'quit =>
EXIT_-WITH_-STATUS(1)
returnToTopLevel()
Index: src/interp/br-con.boot
===================================================================
--- src/interp/br-con.boot (revision 1881)
+++ src/interp/br-con.boot (working copy)
@@ -583,6 +583,7 @@
kisValidType typeForm ==
$ProcessInteractiveValue: fluid := true
$noEvalTypeMsg: fluid := true
+ $BreakMode : local := 'throw_reader
CATCH('SPAD_READER, processInteractive(typeForm, nil))
is [[h,:.],:t] and member(h,'(Type Category)) =>
kCheckArgumentNumbers t and t