David A. Wheeler wrote: > Egil Möller: >> It would also be interresting to implement the Pythonic list features, >> e.g. slices and slice assignment. Extra points for implementing both a >> destructive and a non-destructive version. E.g. > > That was the idea of "bracketaccess", but that means that someone > has to figure out those semantics. > > let > group > a b[1:5] > c d[0:3,x,5:7,9:] > > Hmm, that doesn't look very Lispish - that has lots of > unnecessary punctuation to bite you later when you start manipulating lists.
Wouldn't that depend on what the reader spit out? What if b[1:5] becomes (bracketaccess b (slice 1 5)) and d[0:3,x,5:7,9:] becomes (bracketaccess d '((slice 0 3) x (slice 5 7) (slice 9))) ? In Python, what gets passed to getitem/setitem is any object, including integers and slices (strings for namespace dicts, etc.), or a tuple of the same. Heck, you could stipulate that a list is always passed, even if it's singular, and obtain a nice analogy between list construction using [] and indexing using []. Neil ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss