Re: [racket-dev] collects descriptions

2010-08-23 Thread Jay McCarthy

On Aug 22, 2010, at 10:23 PM, Jon Rafkind rafk...@cs.utah.edu wrote:

 Can someone provide me a somewhat brief description of what the following 
 directories in the collects/ tree contain?
 
 * scribble

The implementation of scribble

 * scribblings

The documentation for most of the core system (guide, reference, htdp langs, 
etc)

 * scriblib

Auxiliary scribble libraries, they have their own documentation linked from the 
top level

 
 I have a vague impression but I don't understand the whole picture.. I think 
 someone (Matthias?) requested a README file for each collect directory, I 
 could put the information provided in such a file for each of these 
 directories.
 _
 For list-related administrative tasks:
 http://lists.racket-lang.org/listinfo/dev

Jay

PS I am up because my daughter was just born. Naturally I thought to respond to 
a mailing list post. :P
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


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

2010-08-23 Thread Noel Welsh
On Mon, Aug 23, 2010 at 12:26 AM, Will M. Farr wmf...@gmail.com wrote:
 Thanks for sharing your code, and for the comments.  Let me see if I 
 understand this correctly: the following code should produce a total, a 
 vector whose elements are the partial sums of elements at lower indices than 
 the corresponding element of the input vector, and a vector whose elements 
 are partial sums of elements at the index and lower indices of the input 
 vector, right?

Yes, that's correct.

 1. In my forms, the length is optional, and distinguished (when provided) 
 from the for-clauses by a keyword argument.  In yours, it must be provided as 
 the first for-clause (thus requiring that the index be named).

Yes. Note that my for/vector form will iterate over the indices even
if no other sequence is provided. Thus you can write stuff like this
(taken from some code of mine):

  (for/vector ([i n]) (create-row (+ i l)))

You can ignore the name if you want:

  (for/vector ([_ n-pts]) ...)

 2. In my forms, the final body expression must produce exactly one value, 
 which becomes the vector element.  In yours, the final body expression must 
 produce exactly as many values as the third argument to the length clause (if 
 provided) or 1 (if no third argument is present).

Yes.

 As for difference 1, I think it's nice to be able to avoid providing a length 
 if I don't want to.  Sometimes I may not really care about the efficiency of 
 the loop, but will later need a vector, in which case it's a lot less effort 
 to use (for/vector ((i (in-range 3))) ...) than to have to provide a length.  
 I also prefer the distinguished #:length keyword instead of shoehorning the 
 length argument into a not-really-for-clause.  I'm curious what others think, 
 however.

I like having the index bound to a name if I want it. Otherwise I'm
fine with specifying it in an alternate way.

 Difference #2 seems more significant to me.  I really like the idea of being 
 able to produce multiple vectors simultaneously---as you say, it can have 
 efficiency benefits and also be really convenient.  However, note that the 
 for/list form does not allow multiple values from the last body expression, 
 so there is an argument from consistency to prohibit it in for/vector as well.

We don't have to repeat the mistakes of the past :)

 I'd be open to adding another keyword argument, however, to designate some 
number of vectors (independently of the presence or absence of the #:length 
keyword) for the output.  I'll put that in the next version, and we can see 
what other people think.  As with the #:length argument, I would prefer this 
to be a separate keyword---maybe #:num-vecs, maybe something else---rather 
than trying to fit it into a special for-clause.

Alternatively, it could be a for/vectors / for/fold/vectors form. I'm neutral.

N.
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


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

2010-08-23 Thread Matthew Flatt
At Sun, 22 Aug 2010 15:36:03 -0500, Will M. Farr wrote:
  Either choice --- error or stopping --- interacts awkwardly with
  `for*/vector'. If you've going to raise an exception, the natural thing
  to do with `for/vector' would be to stop as soon as the sequence goes
  too far. But `for*/vector' with a length currently just uses
  `for*/vector' without the length; you could check afterward, but that
  would be different than the natural choice for `for/vector'.
  
  Along similar lines, every `for/vector' is a `for*/vector' in a way,
  because a `#:when' clause can introduce a nesting. The `for/vector'
  macro with an without a length behaves very differently than the one
  with a length when a `#:when' clause is used.
  
  Maybe `for/vector' with a length clause should be syntactically
  restricted to have no `#:when' clauses, and maybe there just shouldn't
  be a variant of `for*/vector' that supports `#:length'.
 
 I'll make sure to throw a syntax error if I see a #:when in the for-clauses, 
 and I think I should give up on the for*/vector #:length variant.  I was 
 hoping that you would have some sort of neat trick to keep a running counter 
 during the nested iteration

Maybe you want to thread the vector index through using `for/fold'
instead of drawing the index from a sequence. The expansion could
insert enough `#:when' clauses to compare the index to the length
before each nested iteration.

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev