[racket-dev] [plt] Push #23119: master branch updated

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Jul 26 15:58:50 EDT 2011

An hour ago, Jay McCarthy wrote:
> On Mon, Jul 25, 2011 at 12:38 AM, Eli Barzilay <eli at barzilay.org> wrote:
> > Some comments:
> >
> > (1) why `se-path' and not some `xexpr-path'?
> 
> The 's' was intended to be 'simple'

As long as it deals with xexprs, I prefer the more obvious name.  (I
definitely would never remember `se-path' without the docs.)


> > (2) also, it looks bad to use a keyword to look for something that
> >     is a symbols.  How about something like: '(form input #:attr
> >     name)?  Or maybe think of each element as a kind of a
> >     selector, with integers specifying the nth element of a list
> >     and symbols do an assq-style search, so that becomes '(form
> >     input 0 name)?
> 
> This is really quick and dirty for what I need. In my mind, the
> "correct" thing to do is use the sxml2 package and get real XPath
> queries, but this lightweight.

Same here -- as long as xexprs are used, I really think that using
keywords is an abusive pun.  (And I really don't mind switching away
from xexprs if there's a good path up.)


> > (3) I really think that there should be better support for tests in
> >    the documentation...  I've played with it in the past, and I
> >    noticed that you have the same (pretty verbose) code in both the
> >    documentation and test (of the test).
> 
> I 100% agree. Perhaps facets can make this easier.

They obviously can -- in exactly the same way that they help with
`scribble/srcdoc'.  The hack that I played with in the past (the
documentation for `scribble/text') is getting a discount in that I
don't care for loading more code when the tests are run.


> > (4) any reason for this:
> >
> >      (define (test-add-two-numbers -s>)
> >        (define x  ...)
> >        (define xs ...)
> >        (define y  ...)
> >        (define ys ...)
> >        (define r0 ...)
> >        (define k0 ...r0...)
> >        (define i0 ...r0...)
> >        (define r1 ...k0 i0 xs...)
> >        (define k1 ...r1...)
> >        (define i1 ...r1...)
> >        (define r2 ...k1 i1 ys...)
> >        (define n  ...r2...)
> >        ...)
> >
> >    over `let*' or just `set!'?  (The latter is kind of obvious since
> >    you're writing what the set!-using code conceptually expands to
> >    anyway...)
> 
> Because I dislike set! so much, I often program in single-static
> assignment.

I strongly prefer a `let*' over explicitly naming these.  (As Jay
knows...)


> It would be *really* nice if we could have define* from
> racket/package in any definition context, because that's more like
> what I really want anyways.

I would *love* that!  It's especially fitting with the new treatment
of bodies.

(A more radical change would be for `define*' to be called `define'
and add a new `define-rec' for the recursive cases -- but that of
course breaks more things and at the module level it makes more sense
for `define's to be recursive.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!



Posted on the dev mailing list.