Re: [racket-dev] Why is there no `stream' macro which functions analogously to the `list' macro?

2011-12-08 Thread Matthew Flatt
The addition of `stream' makes sense to me. What were the arguments
against?

(For further pull requests, please include test cases --- which in this
case would have caught the use of `stream-empty' instead of
`empty-stream'.)

At Mon, 5 Dec 2011 16:23:09 -0500, Daniel King wrote:
> I initiated a pull request [1] to add a `stream' macro which produces
> streams in much the same way the `list' macro does; however, after
> speaking with Vincent and Stevie, I'm not sure this is the right
> approach.
> 
> I understand that `list' can be used to construct things which can be
> used as streams, but I think it's confusing for the user to require
> racket/stream and not receive a `stream' macro which functions like
> `list'.
> 
> [1] https://github.com/plt/racket/pull/62
> 
> -- 
> Dan King
> College of Computer and Information Science
> Northeastern University

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


Re: [racket-dev] Why is there no `stream' macro which functions analogously to the `list' macro?

2011-12-08 Thread Daniel King
On Thu, Dec 8, 2011 at 09:40, Matthew Flatt  wrote:
> (For further pull requests, please include test cases --- which in this
> case would have caught the use of `stream-empty' instead of
> `empty-stream'.)

Ah, I just realized there's a tests folder at racket/collects/tests.
I'll update the pull request.

-- 
Dan King
College of Computer and Information Science
Northeastern University
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] feature request: gcd, lcm for rationals

2011-12-08 Thread Matthew Flatt
I'll make this change.

At Wed, 07 Dec 2011 12:25:34 -0500, David Van Horn wrote:
> It would be nice if gcd and lcm were extended to rational numbers, which 
> seems in-line with Scheme's philosophy (but not standards) on numbers.
> 
> (define (gcd-rational . rs)
>(/ (apply gcd (map numerator rs))
>   (apply lcm (map denominator rs
> 
> (define (lcm-rational . rs)
>(/ (abs (apply * rs))
>   (apply gcd-rational rs)))
> 
> David

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


Re: [racket-dev] plot doesn't plot (inexact->exact: no exact representation for +nan.0)

2011-12-08 Thread Matthew Flatt
At Tue, 06 Dec 2011 11:13:54 +0100, Marijn wrote:
> Matthew has been trying to determine the cause via private email.
> Matthew, has any of the data I provided so far pointed you anywhere?
> Otherwise is there something else I can do to help debug?

I hope to investigate more soon, and I expect I'll have more debugging
requests for you.

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


Re: [racket-dev] Why is there no `stream' macro which functions analogously to the `list' macro?

2011-12-08 Thread Daniel King
On Thu, Dec 8, 2011 at 09:51, Daniel King  wrote:
> Ah, I just realized there's a tests folder at racket/collects/tests.
> I'll update the pull request.

Done.

-- 
Dan King
College of Computer and Information Science
Northeastern University
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Icons issues

2011-12-08 Thread Neil Toronto

Thanks, Ryan. Now everybody's not angry with me.

Well, Eli still is, but that's nothing new.

Neil T

(I'm just kidding, Eli.)

On 12/07/2011 11:52 PM, Ryan Culpepper wrote:

I've pushed a temporary fix to the dist-specs, and meta/check-dists now
runs without errors. Hopefully the nightly builds will be back tomorrow.
The underlying problem remains, though.

Ryan


On 12/07/2011 03:58 PM, Matthias Felleisen wrote:


Please bring back the nightly build.


On Dec 7, 2011, at 5:41 PM, Robby Findler wrote:


I asked for someone to do something to give us more time two days ago.

Robby

On Wed, Dec 7, 2011 at 4:36 PM, Ryan Culpepper wrote:

On 12/05/2011 12:35 PM, Eli Barzilay wrote:


The icons collection has some issues that need to be resolved:
[...]


* It breaks the dependencies. The error is:

unsatisfied dependency for "dr-bin":
"racket/collects/icons/main.rkt" (in:
"racket/collects/drracket/compiled/syncheck-drracket-button_rkt.dep"
...)

This means that the DrRacket distribution requires "icons/main.rkt",
and that's missing from the distribution.

The reason it's missing is that Matthew tried to fix the more
serious problem that was there before: the new icons requires
`slideshow' and `texpict' (via `unstable/gui/pict'), and since
DrRacket uses it, it now depends on these too.

Potential ways to resolve it:

1. Decide that it's fine to make slideshow and texpict required for
drracket.

2. Dump the idea of making sense and stop making these tests.

3. Avoid the new dependency, and make the code not require that.
Potentially do that by splitting the code into a part that
drracket can use, and a part that is not needed.



The nightly builds have now been failing for seven days. I assume it's
because of this dist-spec issue.

I vote we do #1 to get the nightly builds working again immediately.
When
the parties involved figure out a long-term solution, we can undo the
dist-spec change.

It would also be nice if the particular distributions that did
succeed in
the nightly builds were made available. I assume that the
"plt-everything"
distribution (or whatever it's called) has been succeeding, and that
only a
lesser-used distribution is preventing any updates.

Ryan

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


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


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


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


Re: [racket-dev] Why is there no `stream' macro which functions analogously to the `list' macro?

2011-12-08 Thread Robby Findler
On Thu, Dec 8, 2011 at 8:40 AM, Matthew Flatt  wrote:
> The addition of `stream' makes sense to me. What were the arguments
> against?

I don't know that any were articulated yet, but what would be the
difference between 'stream' and 'list'?

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


Re: [racket-dev] Why is there no `stream' macro which functions analogously to the `list' macro?

2011-12-08 Thread Matthew Flatt
At Thu, 8 Dec 2011 11:58:45 -0600, Robby Findler wrote:
> On Thu, Dec 8, 2011 at 8:40 AM, Matthew Flatt  wrote:
> > The addition of `stream' makes sense to me. What were the arguments
> > against?
> 
> I don't know that any were articulated yet, but what would be the
> difference between 'stream' and 'list'?

The suggested `stream' is a syntactic form whose subexpressions are
evaluated lazily.

Although there hasn't been much time for comments, I'll push the
addition for now; we can take `stream' back out if it's a bad idea.

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


Re: [racket-dev] Why is there no `stream' macro which functions analogously to the `list' macro?

2011-12-08 Thread Robby Findler
On Thu, Dec 8, 2011 at 2:42 PM, Matthew Flatt  wrote:
> At Thu, 8 Dec 2011 11:58:45 -0600, Robby Findler wrote:
>> On Thu, Dec 8, 2011 at 8:40 AM, Matthew Flatt  wrote:
>> > The addition of `stream' makes sense to me. What were the arguments
>> > against?
>>
>> I don't know that any were articulated yet, but what would be the
>> difference between 'stream' and 'list'?
>
> The suggested `stream' is a syntactic form whose subexpressions are
> evaluated lazily.
>
> Although there hasn't been much time for comments, I'll push the
> addition for now; we can take `stream' back out if it's a bad idea.

Seems like a good idea to me.

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


[racket-dev] doc bug - syntax-id-rules

2011-12-08 Thread David Vanderson

I think the docs for syntax-id-rules have 2 lines swapped.  Here's a patch:

diff --git a/collects/scribblings/reference/stx-patterns.scrbl 
b/collects/scribblings/reference/stx-patterns.scrbl

index 83d13bc..209961b 100644
--- a/collects/scribblings/reference/stx-patterns.scrbl
+++ b/collects/scribblings/reference/stx-patterns.scrbl
@@ -459,8 +459,8 @@ corresponding @racket[template].}
 Equivalent to

 @racketblock[
-(lambda (stx)
-  (make-set!-transformer
+(make-set!-transformer
+ (lambda (stx)
(syntax-case stx (literal-id ...)
  [pattern (syntax-protect (syntax template))] ...)))
 ]}


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


[racket-dev] [PATCH] add in-slice sequence

2011-12-08 Thread David Vanderson

Hello,

I was trying to write some code to process a few items at a time from a 
list.  Nothing I came up with looked great, so I wrote an "in-slice" 
sequence function:


> (for/list ([e (in-slice 3 (in-range 8))]) e)
'((0 1 2) (3 4 5) (6 7))

Patch below.  Comments?

Thanks,
Dave



diff --git a/collects/racket/private/for.rkt 
b/collects/racket/private/for.rkt

index 88733ca..9e032fa 100644
--- a/collects/racket/private/for.rkt
+++ b/collects/racket/private/for.rkt
@@ -51,6 +51,7 @@

  in-sequences
  in-cycle
+ in-slice
  in-parallel
  in-values-sequence
  in-values*-sequence
@@ -984,10 +985,30 @@
 (if (and (pair? sequences) (null? (cdr sequences)))
 (car sequences)
 (append-sequences sequences #f)))
+
   (define (in-cycle . sequences)
 (check-sequences 'in-cycle sequences)
 (append-sequences sequences #t))

+  (define (in-slice k seq)
+(when (not (exact-positive-integer? k))
+  (raise (exn:fail:contract "in-slice length must be a positive 
integer"

+  (current-continuation-marks
+(check-sequences 'in-slice (list seq))
+(make-do-sequence
+ (lambda ()
+   (define-values (more? get) (sequence-generate seq))
+   (values
+(lambda (_)
+  (for/list ((i k)
+ #:when (more?))
+(get)))
+values
+#f
+#f
+(lambda (val) (0 . < . (length val)))
+#f
+
   (define (in-parallel . sequences)
 (check-sequences 'in-parallel sequences)
 (if (= 1 (length sequences))
diff --git a/collects/scribblings/reference/sequences.scrbl 
b/collects/scribblings/reference/sequences.scrbl

index d3ecdfb..6192761 100644
--- a/collects/scribblings/reference/sequences.scrbl
+++ b/collects/scribblings/reference/sequences.scrbl
@@ -298,6 +298,16 @@ in the sequence.
   demanded---or even when the sequence is @tech{initiate}d, if all
   @racket[seq]s are initially empty.}

+@defproc[(in-slice [length exact-positive-integer?] [seq sequence?]) 
sequence?]{
+  Returns a sequence where each element is a list with @racket[length] 
elements

+  from the given sequence.
+
+  @examples[
+  (for/list ([e (in-slice 3 (in-range 8))]) e)
+  ]
+
+  }
+
 @defproc[(in-parallel [seq sequence?] ...) sequence?]{
   Returns a sequence where each element has as many values as the number
   of supplied @racket[seq]s; the values, in order, are the values of
diff --git a/collects/tests/racket/for.rktl b/collects/tests/racket/for.rktl
index 691e309..6c883b8 100644
--- a/collects/tests/racket/for.rktl
+++ b/collects/tests/racket/for.rktl
@@ -84,6 +84,15 @@
 (test #t sequence? (in-cycle))
 (test #t sequence? (in-cycle '()))

+(test #t sequence? (in-slice 1 '()))
+(test '() 'empty-seq (for/list ([v (in-slice 1 '())]) v))
+(test '((0 1)) 'single-slice (for/list ([v (in-slice 3 (in-range 2))]) v))
+(test-sequence [((0 1 2) (3 4 5))] (in-slice 3 (in-range 6)))
+(test-sequence [((0 1 2) (3 4 5) (6 7))] (in-slice 3 (in-range 8)))
+(test-sequence [((0 1 2) (3 4 5) (6 7 8)) (0 1 2)]
+(in-parallel (in-slice 3 (in-naturals)) (in-range 3)))
+(err/rt-test (for/list ([x (in-slice 0 (in-range 8))]) x) 
exn:fail:contract?)

+
 (test-sequence [(0 1 2) (a b c)] (in-parallel (in-range 3) (in-list 
'(a b c
 (test-sequence [(0 1 2) (a b c)] (in-parallel (in-range 10) (in-list 
'(a b c
 (test-sequence [(0 1 2) (a b c)] (in-parallel (in-range 3) (in-list 
'(a b c d


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