Re: [stack] peg: a lazy, non-deterministic concatenative language

Joshua Shinavier <[email protected]> Mon, 23 Apr 2012 00:24:58 -0400
Newsgroups gmane.comp.lang.concatenative
Message-ID <CAPKNUSv9Ut=dzrHtkvqwwrCk59SSm8rtOkFRy=7mgCBRLSWQGw@mail.gmail.com>
On Fri, Apr 20, 2012 at 1:21 PM, William Tanksley, Jr <[email protected]
> wrote:
>
> You MIGHT mean composition rather than concatenation. Is that the case?
>
> If so, you've discovered a new subvariant of a "concatenative
> language". The usual rule is "the syntax of concatenation implies the
> semantics of composition", but for your language the rule is "the
> syntax of concatenation implies the semantics of composition of all
> Cartesian products".
>
> I like it.
>
> Now, Enchilada did something similar, but IIRC it didn't do it with
> mere concatenation (van Dalen?); I don't know enough about Ripple to
> say anything, but it either did this or allowed some explicit
> operations to cause it (fortytwo, are you listening?).
>


Present, just lazy :-)

That's an interesting property, but it's not true of Ripple, and lazy
evaluation is the reason it's not true.  Suppose we split a Ripple program
arbitrarily and evaluate the fragments, e.g.

    4 sqrt. 10 add.

to

    4 sqrt.

and

    10 add.

They're both valid programs, yet the right-hand-side program has no
solutions while the complete program has two solutions ([8] and [12], or
(8) and (12) in Ripple syntax).  Any time the right-hand-side does have a
solution, e.g. if the program had been (4 sqrt. 10), which is already fully
reduced, the left-hand-side will never be reduced in the complete program,
so it doesn't matter what its solutions are.

If Ripple used an eager evaluation strategy instead, the "cartesian
composition" rule would more or less hold.


Best,

Josh




>
> Either way, I just learned something new.
>
> -Wm
>
>  
>


[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/concatenative/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/concatenative/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/