On Tue, Aug 14, 2012 at 11:52 PM, Neil Toronto neil.toro...@gmail.com wrote:
Some typed for loops would have to be reimplemented, unless inference
improves a lot. To make this easier, I've attached an example implementation
of `for/vector:' and `for*/vector:'. It allows both body and result
On 08/15/2012 05:24 AM, Sam Tobin-Hochstadt wrote:
On Tue, Aug 14, 2012 at 11:52 PM, Neil Toronto neil.toro...@gmail.com wrote:
Some typed for loops would have to be reimplemented, unless inference
improves a lot. To make this easier, I've attached an example implementation
of `for/vector:'
On Wed, Aug 15, 2012 at 9:54 AM, Neil Toronto neil.toro...@gmail.com wrote:
On 08/15/2012 05:24 AM, Sam Tobin-Hochstadt wrote:
On Tue, Aug 14, 2012 at 11:52 PM, Neil Toronto neil.toro...@gmail.com
wrote:
Some typed for loops would have to be reimplemented, unless inference
improves a lot.
On 08/15/2012 08:05 AM, Sam Tobin-Hochstadt wrote:
On Wed, Aug 15, 2012 at 9:54 AM, Neil Toronto neil.toro...@gmail.com wrote:
When #:length is given, it's similar in that it creates a vector outside the
loop and bangs values into it. But I have to start with (define vs (vector))
and then (set!
At Wed, 15 Aug 2012 07:54:16 -0600, Neil Toronto wrote:
I wouldn't want to because `for/vector' is currently broken when
#:length is given. (See PR 13029 and PR 13030.)
I think the only way to fix it is to implement it like I did: expand to
plain `for:' and mutate an external index.
I
- Original Message -
From: Neil Toronto neil.toro...@gmail.com
To: Sam Tobin-Hochstadt sa...@ccs.neu.edu
Cc: dev@racket-lang.org dev@racket-lang.org
Sent: Wednesday, August 15, 2012 10:36:36 AM GMT -05:00 US/Canada Eastern
Subject: Re: [racket-dev] Wrapping loops for TR isn't working, and
On 08/15/2012 08:39 AM, J. Ian Johnson wrote:
- Original Message -
From: Neil Toronto neil.toro...@gmail.com
To: Sam Tobin-Hochstadt sa...@ccs.neu.edu
So then the first value computed is replicated everywhere? That seems
unappealing as well.
It costs nothing, and if the #:length
2012/8/15 Neil Toronto neil.toro...@gmail.com:
Other options:
1. Raise an error when the vector isn't filled.
2. Return a (Vectorof (U T #f)) (better than (Vectorof (U T 0))?).
3. Always return a vector whose length is the number of iterations.
Or a variation of 2.:
4. Let the user
At Wed, 15 Aug 2012 17:38:18 +0200, Jens Axel Søgaard wrote:
2012/8/15 Neil Toronto neil.toro...@gmail.com:
Other options:
1. Raise an error when the vector isn't filled.
2. Return a (Vectorof (U T #f)) (better than (Vectorof (U T 0))?).
3. Always return a vector whose length is
I've attached my latest. It's possibly better.
On 08/15/2012 08:05 AM, Sam Tobin-Hochstadt wrote:
So then the first value computed is replicated everywhere? That seems
unappealing as well.
I've implemented #:fill in this one. If both #:length and #:fill are
given, the vector is created with
On 08/15/2012 08:05 AM, Sam Tobin-Hochstadt wrote:
On Wed, Aug 15, 2012 at 9:54 AM, Neil Toronto neil.toro...@gmail.com wrote:
BTW, what do you think of deprecating result annotations and using body
annotations instead?
I'm not sure yet.
This short exercise might convince you: implement
There is a similar problem with for/product: . The initial 1 is that an
integer, a real
or a complex?
(for/product: : Real ([i : Integer (in-range 0 5)]) (/ i))
Type Checker: Expected Integer, but got Exact-Rational in:
(for/product: : Real ((i : Integer (in-range 0 5))) (/ i))
It does not
I like the idea of wrapping Racket's standard for loops with a few
annotations and letting inference figure out the rest of the types.
The problem is, it doesn't work very well.
1. Even though the loop's type is technically optional, it seems to
always be required.
2. Many simple loops
13 matches
Mail list logo