On Mon, Mar 12, 2012 at 08:51:23PM +0100, Ralf Hemmecke wrote:
[..]
>> Evidently, I have tried. I change the line
>>
>>             e1 := convert("ab" :: Symbol) $SExpression
>>
>> in the above program to
>>
>>             e1 := ("ab" :: Symbol) :: SExpression
>>
>> , and the FriCAS-1.1.6 compiler reports
>>[..]
>> $x:= (:: (:: ab (Symbol)) (SExpression))
>> $m:= $EmptyMode
>> $f:=
>> ((((|$Information| #) (|f| #) (|$DomainsInScope| # # #) ($ # #) ...)))
>>
>>     >>  Apparent user error:
>>     Cannot coerce (QUOTE ab)
>>        of mode (Symbol)
>>        to mode (SExpression)
>> ---------------------------------------------------------------
>
> Oh, it seems that the Spad compiler behaves nicer here than I thought.  
> It seems that the compiler is using :: exactly like Aldor.
> [..]

> As you see, only the Interpreter
>
> (1) -> ("ab" :: Symbol) :: SExpression
>
>    (1)  ab
>                                             Type: SExpression
>
> figures out that for :: it cannot only use "coerce", but also "convert"  
> and (maybe -- I'm not so sure here --) also "retract".
> [..]
> (13) -> z1+z2
>
>    (13)  1
>                                                       Type:  
> Fraction(Integer)
> (14) -> (z1+z2)::Integer
>
>    (14)  1
>                                                                 Type:  
> Integer
>
> There is neither coerce: Fraction(Integer) -> Integer nor a convert  
> function of this type. Only "retract".
>
> So :: has a different meaning in the interpreter than in the compiler.
>
> Does that help?


I knew that Spad and Interpeter differ in the example with  
`:: SExpression'. In this particular case, no real help was needed.
I thought: "It may occur, the developers could simplify the comipler 
design in this point, if this is not needed, then all right."

Regards,

------
Sergei
[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