On 08 Jan 2008 18:46:46 +0100, Martin Rubey wrote:
>
> Gabriel Dos Reis writes:
>
> > On Tue, 8 Jan 2008, Martin Rubey wrote:
> >
> > |
> > | Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
> > |
> > | > | > Indeed.  And that is what the AXIOM book by Jenks&Sutor documents.
> > | > | > Apologies for asking, but why would we want to change that?
> > | > |
> > | > | Did I say something must be changed?
> > | >
> > | > I don't think I said you, Ralf, suggested that.
> > | >
> > | > My understanding of the discussion was that someone was proposing 
> > something
> > | > different from the documented => iterate.
> > |
> > | No, sorry.  As far as I know, in SPAD,
> > |
> > |   => iterate            (in fact, not sure about that one)
> > |
> > |   => "next"
> > |
> > |   => "iterate"
> > |
> > |   => nil
> > |
> > |   => "leave"
> > |
> > | are all equivalent.  And I proposed to make them all the same.  The 
> > semantics
> > | of => should *not* be changed.
> >
> > My suggestion is that all, except the `=> iterate', are not documented.
>
> What's the documentation of => iterate?
>

Please refer to section 5.4 of the Axiom book concerning:

  =>
  break
  iterate
  return

Elsewhere it is stated: "15.4 Interactive Front-end and Language
The leave keyword has been replaced by the break keyword for compatibility
with the new Axiom extension language. See section 5.4.3 on page 207 for more
information."

> > We should be advertizing only the documented form.
> > Personally, I do not see the need to recommend them.
> >  OpenAxiom will unspport them when I get time.
> > Almost al of them are confusing, specially the `=> "leave"' form.
>
> But the semantics is that
>
>   block1
>   condition =>
>       block2
>   block3
>
> executes block1 and block3 if condition evaluates to false, otherwise block1
> and block2.
>
> In
>
>   condition => "leave"
>
> it will evaluate "leave" if condition evaluates to true.  "leave" evaluates
> to itself, a string.  In a loop, it doesn't matter to what the final block
> of the loop evaluates, the result is thrown away anyway.
>

Becareful to distinguish between

  "leave"

the string and

  leave

the (deprecated) keyword. Presumably

  condition => leave

is just an old form of

  condition => break

which means to exit from a loop.

  condition => "leave"

means only to exit from the block (not the loop!) with the string
value "leave" which is often just thrown away unless it is used in the
context where the value is saved.

Regards,
Bill Page.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to