Ralf Hemmecke wrote:
> 
> Hi Waldek,
> 
> > Well, clearly what compiler generates is different than "obvious" 
> > meaning of the code.  But in general issue is somewhat tricky: '=>'
> > is supposed to exit current block.  In FriCAS single instruction does
> > _not_ form a block...  ATM I would reccomend to use 'if' in such
> > situations.
> 
> You suggest some workaround, but you did not say whether or not you
> agree that this should be considered a bug.
> 
> If something that comes after "repeat" should not always be considered
> as a "block", then I think that is confusing. Maybe it doesn't appear
> too often, that => is a single statement after a "repeat", but if it
> does, it should be compiled in the "obvious" meaning.

Consider:

    ...
    if x > 0 then
        y > 0 => 0
    ...

Should this exit larger block or not?  Arguably, this code could
be written in clearer way, but the same applies to 'repeat'
case ('if' is clearer).

Now, I consider it a bug in Spad language that it is not clear
enough what should happen in such cases.  And I probably would
prefer spec saying that in cases above single instruction
is in fact a block.  But that is larger issue that needs to
be worked out, in particular we should look at conseqences
in various cases.  And only having firm language spec we
should hack compiler to conform to the spec.  Of course,
if proposed spec is hard to implement, then there is red
sign that maybe it is too complicated.  But spec should
go first...

-- 
                              Waldek Hebisch

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/E1hs4jG-0006nl-Mw%40hera.math.uni.wroc.pl.

Reply via email to