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

2012-10-17 Thread Sam Tobin-Hochstadt
On Tue, Oct 16, 2012 at 7:55 PM, Stephen Bloch bl...@adelphi.edu wrote:
 Another data point: If define/match expands to a define of a procedure
 that dispatches to a set of implementations based on a pattern-match of
 actual arguments... then the name is exactly what I'd expect for such a
 feature in a Scheme dialect.

 That is, in fact, exactly what it does.

 Cool!  My students have been writing code that way for years, and I've been 
 telling them There are languages in which that would work, but Scheme isn't 
 one of them.

 (define (swap (make-posn x y))
 (make-posn y x))

The syntax looks like:

  (define/match (swap p)
 [(posn x y) (posn y x)])

-- 
sam th
sa...@ccs.neu.edu
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Pre-Release Checklist for v5.3.1

2012-10-17 Thread Michael Sperber

Ryan Culpepper r...@cs.utah.edu writes:

 * Mike Sperber sper...@deinprogramm.de
   - DMdA Tests
   - Stepper Tests
   - Signature Tests

Done.

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


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

2012-10-17 Thread Robby Findler
What is 'p' in this example?

On Wednesday, October 17, 2012, Sam Tobin-Hochstadt wrote:

 On Tue, Oct 16, 2012 at 7:55 PM, Stephen Bloch 
 bl...@adelphi.edujavascript:;
 wrote:
  Another data point: If define/match expands to a define of a
 procedure
  that dispatches to a set of implementations based on a pattern-match of
  actual arguments... then the name is exactly what I'd expect for such a
  feature in a Scheme dialect.
 
  That is, in fact, exactly what it does.
 
  Cool!  My students have been writing code that way for years, and I've
 been telling them There are languages in which that would work, but Scheme
 isn't one of them.
 
  (define (swap (make-posn x y))
  (make-posn y x))

 The syntax looks like:

   (define/match (swap p)
  [(posn x y) (posn y x)])

 --
 sam th
 sa...@ccs.neu.edu javascript:;
 _
   Racket Developers list:
   http://lists.racket-lang.org/dev

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


Re: [racket-dev] API naming conventions (Push #25466)

2012-10-17 Thread Michael Wilber
Agreed.

I wonder if we couldn't find a way to mirror the distinction between
(define x ...) and (define (x) ...) somehow, combining the functionality
of match-define and define/match. After all, we don't have define-var
and define-fun, right?

(match/define (list x y z) '(1 2 3))

x -- 1

(match/define (do-x (list 2 _ y))
  (list 1 2 y))

(do-x '(2 3 4)) -- '(1 2 4)

where the second one expands into
(define do-x (match-lambda [(list 2 _ y) ...]))
or something like that. Too bad there's ambiguity...

Robby Findler ro...@eecs.northwestern.edu writes:
 For the record, I find having two things that combine match and define
 in different ways where the name difference is - vs / and swapping the
 order of the words to be quite unfortunate.

 Plus, we should just have match built into all of the binding forms.

 Robby

 On Tue, Oct 16, 2012 at 5:48 PM, Eli Barzilay e...@barzilay.org wrote:
 A few minutes ago, Matthias Felleisen wrote:

 Eli, can you explain again -- perhaps in different words -- why
 define/match is a bad name? I understand that we have match-define
 and define/match now. While I agree that having two of these forms
 with remotely related functionality is possibly confusing, I don't
 see why match-define is really a better kind of name than
 define/match.

 Well, I suggested `match-define' (before I realized that there was
 already one) because it follows the same naming convention for the
 rest of the library.


 If you are saying, that define/match is bad because it is too
 distinct from match-define I understand the name argument.

 If that was the only issue, then I wouldn't have objected so strongly
 to it -- but the fact that there *is* an existing `match-define', and
 the fact that it does something different, mean that the match
 interface becomes extremely confusing.  And that's not only for
 newbies -- I can easily see myself not remembering which one of them
 is doing which job.


 A bit later, John Clements wrote:

 Violent agreement; I'm saying that the *names* are the same (modulo
 a stylistic choice), not that the meanings are the same.

 As for an attempt to explain why they're a bad combination, John
 indeed put it nicely here.  We have two forms whose meaning is a
 combination of a `define' and a `match', and hanging the difference on
 the order of the two terms (and a `/' vs a `-') means that for human
 readers, the difference is far from apparent.

 And Matthias Felleisen added:

 (I really dislike match-define. But it's historic so we're stuck.)

 I completely agree -- I'd prefer a `define-match' or a `define/match',
 in the same way that I'd also prefer a `let-match' etc.  (And I also
 agree that the historic choice is an important restriction.)

 --
   ((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
 _
   Racket Developers list:
   http://lists.racket-lang.org/dev
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] build problems on plt/release branch?

2012-10-17 Thread Danny Yoo
Does anyone else see severe build problems on the plt/release branch?
 I'm seeing a lot of compile-time errors during 'raco setup'; it's
making it difficult to test things because when a problem occurs, I'm
not sure if it's my fault or if the repo is just in a weird state.

I made sure to clean my local repository by doing:

   git clean -fdx

at the root of the git repo, just to make sure nothing else was
interfering with the build.


I'm at 513f85baa2051cd7428ac008e5b2d1e6858f52d6.  I'm including a
sampling of the output below:



raco setup: 0 making: tmp/racket/collects/2htdp (HtDP/2e Teachpacks)
image.rkt:37:9: module: identifier already imported from: (all-except
../mrlib/image-c...
  at: render-image
  in: private/image-more.rkt
  context...:
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:350:0: compile-zo*
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:551:26
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:544:42
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:509:0: maybe-compile-zo
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:622:2: do-check
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:696:4
   /Users/dyoo/local/racket/collects/setup/parallel-do.rkt:419:20: loop

order.rkt:17:0: define-generics: bad syntax
  in: (define-generics (ordered-dict gen:ordered-dict
prop:ordered-dict ordered-dict? #:defined-table dict-def-table
#:prop-defined-already? #f) (dict-iterate-least ordered-dict)
(dict-iterate-greatest ordered-dict) (dict-iterate-least/?
ordered-dict key) (d...
  context...:
   /Users/dyoo/local/racket/collects/racket/private/modbeg.rkt:46:4
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:350:0: compile-zo*
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:551:26
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:544:42
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:509:0: maybe-compile-zo
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:622:2: do-check
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:696:4
   /Users/dyoo/local/racket/collects/setup/parallel-do.rkt:419:20: loop


raco setup: 0 making: tmp/racket/collects/errortrace/private
namespace-attach-module: unknown module (in the source namespace)
  name: 
#resolved-module-path:/Users/dyoo/local/racket/collects/errortrace/errortrace-key.rkt
  context...:
   
/Users/dyoo/local/racket/collects/tmp/racket/collects/errortrace/errortrace-lib.rkt:474:0:
make-errortrace-compile-handler
   
/Users/dyoo/local/racket/collects/tmp/racket/collects/errortrace/errortrace-lib.rkt:
[running body]
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:350:0: compile-zo*
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:551:26
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:544:42
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:509:0: maybe-compile-zo
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:622:2: do-check
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:696:4
   /Users/dyoo/local/racket/collects/setup/parallel-do.rkt:419:20: loop


raco setup: 0 making: tmp/racket/collects/honu/core
define-honu-syntax: expected argument of type procedure (arity 1);
given: #procedure:...syntax-parse.rkt:13:2
  context...:
   /Users/dyoo/local/racket/collects/honu/core/private/transformer.rkt:18:0:
make-honu-transformer
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:350:0: compile-zo*
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:551:26
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:544:42
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:509:0: maybe-compile-zo
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:622:2: do-check
   /Users/dyoo/local/racket/collects/compiler/cm.rkt:696:4
   /Users/dyoo/local/racket/collects/setup/parallel-do.rkt:419:20: loop
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] build problems on plt/release branch?

2012-10-17 Thread Ryan Culpepper
Try building the release branch in a fresh clone. (It should be safe to 
clone your existing clone (or checkout) rather than clone directly 
from the server.) If the errors go away, I would suspect the problem is 
that git clean missed some things.


I just tried it and encountered no errors.

Ryan


On 10/17/2012 01:13 PM, Danny Yoo wrote:

Does anyone else see severe build problems on the plt/release branch?
  I'm seeing a lot of compile-time errors during 'raco setup'; it's
making it difficult to test things because when a problem occurs, I'm
not sure if it's my fault or if the repo is just in a weird state.

I made sure to clean my local repository by doing:

git clean -fdx

at the root of the git repo, just to make sure nothing else was
interfering with the build.


I'm at 513f85baa2051cd7428ac008e5b2d1e6858f52d6.  I'm including a
sampling of the output below:



raco setup: 0 making: tmp/racket/collects/2htdp (HtDP/2e Teachpacks)
image.rkt:37:9: module: identifier already imported from: (all-except
../mrlib/image-c...
   at: render-image
   in: private/image-more.rkt
   context...:
/Users/dyoo/local/racket/collects/compiler/cm.rkt:350:0: compile-zo*
/Users/dyoo/local/racket/collects/compiler/cm.rkt:551:26
/Users/dyoo/local/racket/collects/compiler/cm.rkt:544:42
/Users/dyoo/local/racket/collects/compiler/cm.rkt:509:0: maybe-compile-zo
/Users/dyoo/local/racket/collects/compiler/cm.rkt:622:2: do-check
/Users/dyoo/local/racket/collects/compiler/cm.rkt:696:4
/Users/dyoo/local/racket/collects/setup/parallel-do.rkt:419:20: loop

order.rkt:17:0: define-generics: bad syntax
   in: (define-generics (ordered-dict gen:ordered-dict
prop:ordered-dict ordered-dict? #:defined-table dict-def-table
#:prop-defined-already? #f) (dict-iterate-least ordered-dict)
(dict-iterate-greatest ordered-dict) (dict-iterate-least/?
ordered-dict key) (d...
   context...:
/Users/dyoo/local/racket/collects/racket/private/modbeg.rkt:46:4
/Users/dyoo/local/racket/collects/compiler/cm.rkt:350:0: compile-zo*
/Users/dyoo/local/racket/collects/compiler/cm.rkt:551:26
/Users/dyoo/local/racket/collects/compiler/cm.rkt:544:42
/Users/dyoo/local/racket/collects/compiler/cm.rkt:509:0: maybe-compile-zo
/Users/dyoo/local/racket/collects/compiler/cm.rkt:622:2: do-check
/Users/dyoo/local/racket/collects/compiler/cm.rkt:696:4
/Users/dyoo/local/racket/collects/setup/parallel-do.rkt:419:20: loop


raco setup: 0 making: tmp/racket/collects/errortrace/private
namespace-attach-module: unknown module (in the source namespace)
   name: 
#resolved-module-path:/Users/dyoo/local/racket/collects/errortrace/errortrace-key.rkt
   context...:

/Users/dyoo/local/racket/collects/tmp/racket/collects/errortrace/errortrace-lib.rkt:474:0:
make-errortrace-compile-handler

/Users/dyoo/local/racket/collects/tmp/racket/collects/errortrace/errortrace-lib.rkt:
[running body]
/Users/dyoo/local/racket/collects/compiler/cm.rkt:350:0: compile-zo*
/Users/dyoo/local/racket/collects/compiler/cm.rkt:551:26
/Users/dyoo/local/racket/collects/compiler/cm.rkt:544:42
/Users/dyoo/local/racket/collects/compiler/cm.rkt:509:0: maybe-compile-zo
/Users/dyoo/local/racket/collects/compiler/cm.rkt:622:2: do-check
/Users/dyoo/local/racket/collects/compiler/cm.rkt:696:4
/Users/dyoo/local/racket/collects/setup/parallel-do.rkt:419:20: loop


raco setup: 0 making: tmp/racket/collects/honu/core
define-honu-syntax: expected argument of type procedure (arity 1);
given: #procedure:...syntax-parse.rkt:13:2
   context...:
/Users/dyoo/local/racket/collects/honu/core/private/transformer.rkt:18:0:
make-honu-transformer
/Users/dyoo/local/racket/collects/compiler/cm.rkt:350:0: compile-zo*
/Users/dyoo/local/racket/collects/compiler/cm.rkt:551:26
/Users/dyoo/local/racket/collects/compiler/cm.rkt:544:42
/Users/dyoo/local/racket/collects/compiler/cm.rkt:509:0: maybe-compile-zo
/Users/dyoo/local/racket/collects/compiler/cm.rkt:622:2: do-check
/Users/dyoo/local/racket/collects/compiler/cm.rkt:696:4
/Users/dyoo/local/racket/collects/setup/parallel-do.rkt:419:20: loop
_
   Racket Developers list:
   http://lists.racket-lang.org/dev



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


Re: [racket-dev] build problems on plt/release branch?

2012-10-17 Thread Eli Barzilay
A few minutes ago, Ryan Culpepper wrote:
 Try building the release branch in a fresh clone. (It should be safe
 to clone your existing clone (or checkout) rather than clone
 directly from the server.) If the errors go away, I would suspect
 the problem is that git clean missed some things.
 
 I just tried it and encountered no errors.

It's even better to start from the release source distribution, and
build that instead of working from a repository.  This is useful in
providing another test that the source releases actually work.

-- 
  ((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] Math library initial commit almost ready; comments on issues welcome

2012-10-17 Thread Neil Toronto

On 10/01/2012 02:06 PM, Sam Tobin-Hochstadt wrote:

On Mon, Oct 1, 2012 at 2:26 PM, Neil Toronto neil.toro...@gmail.com wrote:

  * `math/base' re-exports `racket/math', but with extra constants (like
`phi.0') and functions (like `power-of-two?'). It also exports improved
hyperbolic functions, such as a new `sinh' that's much more accurate near
zero: in the worst case, 2e-16 relative error (which is great) instead of
0.5 (which is really bad). But its type in `math/base' is

   (case- (Zero - Zero)
   (Flonum - Flonum)
   (Real - Real)
   (Float-Complex - Float-Complex)
   (Complex - Complex))

I haven't been able to give it a type as specific as the type of the `sinh'
exported from `racket/math'.


Why aren't you able to do this?


Shortly, because the type checker doesn't have enough information to 
check only reachable code in each pass through the function's 
definition. Here's `flsinh' without most of its implementation, and with 
only three of its potential `case-' types:


  #lang typed/racket

  (require racket/flonum)

  (: flsinh+ (Positive-Flonum - Positive-Flonum))
  (define (flsinh+ x) (error 'unimplemented))

  (: flsinh (case- (Negative-Flonum - Negative-Flonum)
(Positive-Flonum - Positive-Flonum)
(Flonum - Flonum)))
  (define (flsinh x)
(cond [(x . fl . 0.0)  (flsinh+ x)]
  [(x . fl . 0.0)  (- (flsinh+ (- x)))]
  [else  x]))

While TR checks the definition of `flsinh' with the type Negative-Flonum 
- Negative-Flonum, it gives this type error:


  Type Checker: Expected Negative-Flonum, but got Positive-Flonum in:
  (flsinh+ x)

It doesn't know that (flsinh+ x) is unreachable when x : 
Negative-Flonum. There are similar type errors in the second clause with 
flsinh : Positive-Flonum - Positive-Flonum.


This definition also fails in the same way:

  (define (flsinh x)
(cond [(negative? x)  (- (flsinh+ (- x)))]
  [(positive? x)  (flsinh+ x)]
  [else  x]))

This definition gives only one type error, in the first clause:

  (define (flsinh x)
(cond [((make-predicate Positive-Flonum) x)  (flsinh+ x)]
  [((make-predicate Negative-Flonum) x)  (- (flsinh+ (- x)))]
  [else  x]))

By the second clause, x : Negative-Flonum when `flsinh' has either type. 
(It actually leaves Flonum-Nan out of the type of `x', which is 
impressively correct. :D)


This WOULD work:

  (define (flsinh x)
(cond [(flpositive? x)  (flsinh+ x)]
  [(flnegative? x)  (- (flsinh+ (- x)))]
  [else  x]))

if I could define `flpositive?' and `flnegative?' with the types

  (: flnegative? (case- (Nonnegative-Flonum - False : Nothing)
 (Flonum - Boolean : Negative-Flonum)))

  (: flpositive? (case- (Nonpositive-Flonum - False : Nothing)
 (Flonum - Boolean : Positive-Flonum)))

But I haven't been able to implement them for the same reason I can't 
define `flsinh' with more specific types. Also, it looks like a hack.


Neil ⊥

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


Re: [racket-dev] Pre-Release Checklist for v5.3.1

2012-10-17 Thread David Van Horn

On 10/16/12 12:58 AM, Ryan Culpepper wrote:

* David Van Horn dvanh...@ccs.neu.edu
   - EoPL Tests


Done.


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


Re: [racket-dev] Pre-Release Checklist for v5.3.1

2012-10-17 Thread Jon Rafkind

 * Jon Rafkind rafk...@cs.utah.edu
   Release tests for (one of the) linux releases:
   - Test that the `racket' and `racket-textual' source releases
 compile fine (note that they're still called `plt' and `mz' at
 this stage).
   - Test that the binary installers for both work, try each one in
 both normal and unix-style installation modes. (just ubuntu)
   [Note: get the release candidates from the URL in this email. Use
the 'static table' link to see a list of all tar files available]

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


Re: [racket-dev] Pre-Release Checklist for v5.3.1

2012-10-17 Thread Robby Findler
On Mon, Oct 15, 2012 at 11:58 PM, Ryan Culpepper r...@cs.utah.edu wrote:
 * Robby Findler ro...@eecs.northwestern.edu
   - DrRacket Tests
   - Framework Tests
   - Contracts Tests
   - Games Tests
   - Teachpacks Tests: image tests
   - PLaneT Tests
   - Redex Tests
   Updates:
   - DrRacket Updates: update HISTORY
   - Redex Updates: update HISTORY
   (updates should show v5.3.1 as the most current version)
   - Ensure that previous version of DrRacket's preference files still
 starts up with new DrRacket
   - Update man pages in racket/man/man1: drracket.1

Done.

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


Re: [racket-dev] Pre-Release Checklist for v5.3.1

2012-10-17 Thread Matthew Flatt
At Tue, 16 Oct 2012 00:58:32 -0400, Ryan Culpepper wrote:
 * Matthew Flatt mfl...@cs.utah.edu
- Racket Tests
- Languages Tests
- GRacket Tests (Also check that `gracket -z' and `gracket-text' still
  works in Windows and Mac OS X)

Done.

- mzc --exe tests

Repair pushed for merge.

- .plt-packing Tests
- Games Tests
- Unit Tests
- Syntax Color Tests
- R6RS Tests
- JPR's test suite
- Create an executable from a BSL program
- Run COM tests
- Try compiling with -funsigned-char

Done.

- Racket Updates: update HISTORY

Change pushed for merge.

- Update man pages in racket/man/man1: racket.1, gracket.1, raco.1

No changes.

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


Re: [racket-dev] Pre-Release Checklist for v5.3.1

2012-10-17 Thread Stephen Chang
 * Stephen Chang stch...@ccs.neu.edu
   - Lazy Racket Tests
   - Lazy stepper tests

pass










 * Eli Barzilay e...@barzilay.org
   - Swindle Tests
   - XREPL Tests
   - Racket Tree: compare new distribution tree to previous one
   - Run the unix installer tests
   - Run zsh completions tests (_racket --self-test)
   Version Updates: if a major change has happened, update the version
   number in:
   - racket/collects/mzscheme/info.rkt
   - racket/collects/mred/info.rkt

 * Stephen Bloch sbl...@adelphi.edu
   - Picturing Programs Tests

 * Greg Cooper g...@cs.brown.edu
   - FrTime Tests

 * Carl Eastlund c...@ccs.neu.edu
   - Dracula Tests (confirm that Dracula runs from PLaneT)

 * Jon Rafkind rafk...@cs.utah.edu
   Release tests for (one of the) linux releases:
   - Test that the `racket' and `racket-textual' source releases
 compile fine (note that they're still called `plt' and `mz' at
 this stage).
   - Test that the binary installers for both work, try each one in
 both normal and unix-style installation modes. (just ubuntu)
   [Note: get the release candidates from the URL in this email. Use
the 'static table' link to see a list of all tar files available]

 * Mike Sperber sper...@deinprogramm.de
   - DMdA Tests
   - Stepper Tests
   - Signature Tests

 * David Van Horn dvanh...@ccs.neu.edu
   - EoPL Tests

 * Neil Toronto neil.toro...@gmail.com
   - Plot Tests
   - Images Tests
   - Inspect icons

 * Doug Williams m.douglas.willi...@gmail.com
   - Additional Plot Tests

 * Danny Yoo d...@cs.wpi.edu
   - Whalesong Tests (confirm that Whalesong runs from PLaneT)

 * Shriram Krishnamurthi s...@cs.brown.edu
   Tour: check the tour and generate a new one if needed.
   [Note: Since this is a v5.3.0.900 build, you will need to edit your
 .../collects/framework/private/version.rkt
   file and change `(version)' to `5.3.1'.]
_
  Racket Developers list:
  http://lists.racket-lang.org/dev