Waldek,
Thanks for the suggestion. I did have some success
(1) -> )lisp (defun string2spad (the-string) (let* ( (*standard-input*
(make-string-input-stream the-string)) ) (|spadCompile| nil) ))
Value = STRING2SPAD
1) -> )lisp (string2spad (concat ")abbrev domain XXX xxx" #\Linefeed
"xxx():SetCategory==Integer"))
XXX abbreviates domain xxx
Function declaration xxx : () -> SetCategory has been added to
workspace.
Type: Void
Value = T
----
But this does not seem to actually call the compiler! Instead the two
lines of input appear to be processed by the interpreter. Why? I must
be calling the compiler in the wrong manner.
Of course I would really like to be able to pass the string from interpreter.
(1) -> S:=")abbrev domain XXX xxx"
(1) ")abbrev domain XXX xxx"
Type: String
(2) -> STRING2SPAD(S)$lisp
The function STRING2SPAD is not implemented in NIL .
(2) ->
-----
But here I do not understand the error message above. I thought I
should be able to call the lisp function that I definted.
Alternatively I might be able to reference the interpreter variable
from lisp but I have forgotten exactly how to construct the variable
name at the lisp level. Hints?
Regards,
Bill Page.
On Fri, Mar 4, 2011 at 4:58 PM, Waldek Hebisch <[email protected]> wrote:
> Bill Page wrote:
>>
>> If I have a (long) string X containing some SPAD code with lines
>> separated by newline \n characters is there some way to get the
>> same effect as calling
>>
>> )compile xxx
>>
>> without writing X to a temporary file named 'xxx.spad'? Maybe at the
>> Lisp/Boot level?
>>
>
> I am affraid there is no easy way. One possibility is to create
> string stream, bind it to *standard-input* and call |spadCompile|
> with input file beeing NIL (all at Lisp level).
>
--
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.