Ralf Hemmecke wrote:
> 
> Why does foo(true, true) not output the same as bar(true, true)?
> Obviously, => means something
> 
> echo ")r foo.input" | fricas -nosman
> 
> foo(true, false)
> 
>    (3)  "mooTT"          <--- WRONG

AT first glance it looks like a bug.
 
> =====================================
> 
> (6) -> )co foo.spad
> 
> (6) -> bar(true, true)
> 
>    (6)  "TT"            <----WRONG
> 
> aldor -grun -laldor foo.as
> mooTT

AFAICS this is deliberate differentce between Spad and Aldor.
Playing devils advocate: '=>' at the end of pile can be easily
replaced by 'if' so loss is small.  OTOH in many cases in oder
to evaluate conditions we need to do some computations, which
are valid only conditionally.  If we put '=>' in the main
sequence we commit to subbranch, which may be wrong.  So
with current semantics:

    if cond1 then
        - computation
        cond2 => ...
    -- other cases

gives effect which is hard to do in Aldor way.  More precisely,
Aldor has 'goto' which solves this and more general problems.
But ATM Spad has no 'goto', so it is hard to get the same
effect with Aldor semantics.

We can change Spad to match Aldor.  However, the remark above
shows that to gain regularity we loose some expressive power.

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

Reply via email to