Serge D. Mechveliani wrote:
> 
> People,
> there is a strange effect:
> 
> ------------------------------------------
> Put  "2+3"  to  axInput.txt, 
> 
> -> iFile : File String := open("axInput.txt", "input")
> 
>    axInput.txt  ...
> 
> -> read! iFile
> 
>    (12)  "2+3"
>                                            Type: String
> (13) -> parse(%)$InputForm
> 
>    >> System error:
>    |2+3| is not of type SEQUENCE.
> ---------------------------------------------------------
> 
> The same is when the program transmits it as  iStr = read! iFile
>                                               parse(iStr)$InputForm
>               
> But     parse("2+3")$InputForm    evaluates to  (+ 2 3)  : InputForm.
> 
> And according to the report of      (12)  "2+3"
>                                                   Type: String,
> %  and  ("2+3" : String)  are the same.
> 
> Where is the error?  What is this `|' ?
> Thank you in advance for explanation,

AFAICS you have '2+3' without string quotes.  The '|' in the
output means that you got Lisp symbol, not a string.
Put string quotes around it and your example will
work.

Note: due to type declarations print function "knows" it
has string so puts string quotes around the result,
but in fact argument is of wrong lowe levle type.
By accident print function "works", but parse bombs.

As I wrote, File(String) expects data written in specific
way, otherwise you get stange results as above.  In
particular reading incorrectly formated data is one of
few ways to break type safety in FriCAS.

-- 
                              Waldek Hebisch
[email protected] 

-- 
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.

Reply via email to