On 9/19/07, Nick Alexander <[EMAIL PROTECTED]> wrote:
> > I am going to wait a while to see what brews up, even though
> > the majority vote was against [a..b].
> >
> > At a minimum I would like to implement that for the preparser (or
> > have somebody else do so), and see what it feels like to use in
> > practice
> > in Sage.
>
> I think tomorrow I will do this, and perhaps refactor the preparser
> slightly while I am there.  It seems like we should be able to use
> open and half open intervals, so not only
> [1..2] and (0..3) are valid but also are [0..2) and (0..2] are.  In
> fact, I will try to specify an encoding to range that allows for
> something like
>
> [0, 2, .. 8) which should be [0, 2, 4, 6] by my calculation.
>
> As for iterators versus lists, I favour distinct notations for
> distinct ideas.  Perhaps <[ and )>?  I don't know.

Magma has tons of weird complicated notations like that,
e.g., things like {@ 1,2,3 @} are routine in Magma.  They are
very unpleasant and confusing to read, since it is hard to remember
what they do, and they look funny.  So I'm against more complicated
notation like that.

Nick wrote:
> [1..2] and ]2..3[ instead :)  It looks alien, but it's more likely to
> parse.  Although in mathematical python code, square brackets are
> very common too :)

I would like to just stick with square brackets, and maybe (much?) later
consider other options.

Robert wrote:
> I've actually already started doing this (almost done). Refactoring
> the preparser is very needed though, and perhaps another
> implementation to play with would be good.

Whoever refactors the preparser, please try hard to do it in a way
that isn't harder to understand and work on.  The current design,
for all its flaws, is clearly actually easy to understand and work on,
since the following people have all done significant work on it:
me, Nick Alexander, Joe Wetherell, Bobby Moretti, and Robert
Bradshaw.   I.e., just make sure it is still as easy to understand
(that could just be a matter of documentation).

Robert:
> The half-open idea is an interesting one, but unbalanced ()'s and
> []'s in code hurts my eyes.

I very much agree.

Robert:
> I think using [] to specify lists is clean and pythonic. We are
> basically extending the grammar
> list_display ::=
>             "[" [listmaker] "]"

Yep.  It make sense.   It's possibly not even completely unreasonable
that this notation could eventually (and I mean in a long long time)
make its way into Python.

William

William

--~--~---------~--~----~------------~-------~--~----~
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/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to