Re: [racket-dev] Need a clarification on the implementation of stream-map

2012-07-09 Thread Matthias Felleisen

On Jul 8, 2012, at 7:25 AM, Daniel King wrote:

  (define (stream-map f s)
(unless (procedure? f) (raise-argument-error 'stream-map procedure? f))
(unless (stream? s) (raise-argument-error 'stream-map stream? s))



On a related note, the above kind of checks should really become real 
contracts.  -- Matthias





(let loop ([s s])
  (cond
   [(stream-empty? s) empty-stream]
   [else (stream-cons (call-with-values (lambda () (stream-first s)) f)
  (loop (stream-rest s)))])))





_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Custom write that pretty-prints and works well with quote?

2012-07-09 Thread Neil Toronto
Yes! And `make-tentative-pretty-print-output-port' is helpful mostly 
because grepping for it in the source led me to racket/set.rkt, which 
is like an extended example.


Thanks!
Neil ⊥

On 07/08/2012 09:17 AM, Matthew Flatt wrote:

Do `prop:custom-print-quotable' and/or
`make-tentative-pretty-print-output-port' from `racket/pretty' help?

At Sat, 07 Jul 2012 11:40:49 -0700, Neil Toronto wrote:

I've got an array structure like so:

(struct: (A) strict-array ([shape : (Listof Index)]
 [data : (Vectorof A)])

Say I have this value:

  (strict-array '(2 2) #(1 2 3 4))

I want it to print like this at the REPL:

  #strict-array '(2 2) '[[1 2] [3 4]]

If there's not enough room, I want this:

  #strict-array
'(2 2)
'((1 2) (3 4))

If it happens to be in a list, I want this:

  (list #strict-array '(2 2) '[[1 2] [3 4]])

and definitely NOT '(#strict-array '(2 2) '[[1 2] [3 4]]) because the
inner quotes are confusing.

How do I do that with prop:custom-write? The only way I've found so far
to get nicely formatted output is to write/display/print a list, but
then the quotes get messed up. I haven't found a way to keep the REPL
from quoting lists of structs, except to go with the default printer,
which flattens arrays, which makes them hard to read.

This is frustrating.

Neil ⊥
_
   Racket Developers list:
   http://lists.racket-lang.org/dev



_
 Racket Developers list:
 http://lists.racket-lang.org/dev


[racket-dev] Release for v5.3 is about to begin

2012-07-09 Thread Ryan Culpepper
The release process for v5.3 will begin in about a week. If you have any 
new features that you want in and are relatively close to being done, 
now is a good time to do that.

--
Ryan
_
 Racket Developers list:
 http://lists.racket-lang.org/dev


Re: [racket-dev] [racket] Insert Pict Box menu item not found in DrRacket

2012-07-09 Thread Asumu Takikawa
On 2012-07-08 15:47:27 +0800, Grecks Grecks wrote:
Hi, I post an issue on github 2 month before. 
[1]https://github.com/plt/racket/issues/101

For devs: while fixing this, I noticed that the code that used to
implement this menu item is still around (along with string constants)
but are unused. Should I remove that code while I'm at it?

Cheers,
Asumu
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Release for v5.3 is about to begin

2012-07-09 Thread Neil Toronto
I suppose this means it's a bad time for the initial commits for the 
`math' library. :D


I'd like to make `math/array' accessible to Jens Axel so he can start on 
the linear algebra parts. What are my options?


Neil ⊥

On 07/09/2012 01:24 PM, Ryan Culpepper wrote:

The release process for v5.3 will begin in about a week. If you have any
new features that you want in and are relatively close to being done,
now is a good time to do that.
--
Ryan
_
  Racket Developers list:
  http://lists.racket-lang.org/dev

_
 Racket Developers list:
 http://lists.racket-lang.org/dev


Re: [racket-dev] Release for v5.3 is about to begin

2012-07-09 Thread Eli Barzilay
30 minutes ago, Neil Toronto wrote:
 I suppose this means it's a bad time for the initial commits for the
 `math' library. :D

As long as it's new code, there's no problem.

-- 
  ((lambda (x) (x x)) (lambda (x) (x x)))  Eli Barzilay:
http://barzilay.org/   Maze is Life!
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Release for v5.3 is about to begin

2012-07-09 Thread Neil Toronto

On 07/09/2012 06:48 PM, Eli Barzilay wrote:

30 minutes ago, Neil Toronto wrote:

I suppose this means it's a bad time for the initial commits for the
`math' library. :D


As long as it's new code, there's no problem.


It's unfinished and undocumented, and lacks serious testing. I'd rather 
it not get into the release in that state. Is that not a problem?


Neil ⊥
_
 Racket Developers list:
 http://lists.racket-lang.org/dev


Re: [racket-dev] Release for v5.3 is about to begin

2012-07-09 Thread Neil Toronto

On 07/09/2012 06:54 PM, Eli Barzilay wrote:

[But if your main concern is sharing work, then you can just as well
go with a GH fork, and either make a nice single commit when it's
ready, or push your commits in a single batch.]


Ha! Thanks for reminding me that I DO have a git server out there 
somewhere. Forking and cloning now...


Neil ⊥
_
 Racket Developers list:
 http://lists.racket-lang.org/dev