Re: [racket-dev] Preserving trailing zeros in formatting numbers as strings

2014-05-03 Thread Kathi Fisler
Thanks, Asumu.  I hadn't known about the ~r-like formatters.

Kathi


On Fri, May 2, 2014 at 4:52 PM, Asumu Takikawa as...@ccs.neu.edu wrote:

 On 2014-04-24 05:25:07 -0400, Kathi Fisler wrote:
 I'm generating class notes in HTML via scribble.  I'm trying to
 include
 the number 10.50 (as a price in an test case, so the trailing 0
 matters).
  I'm using format to produce the strings that go into the rendered
 html.
  When I do this (whether with ~a or ~s), the trailing 0 is dropped,
 producing 10.5 in my output instead of 10.50.

 Maybe this is too late to be useful (I think the mailing list ate your
 post?), but here's one way to do it:

(~r 10.5 #:precision '(= 2))
   10.50

 Cheers,
 Asumu


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


[racket-dev] requested package not available: draw-x86_64-macosx-2

2014-05-03 Thread David Van Horn
I just did a git pull and make and get the following error:

racket/bin/racket -U -G build/config racket/src/link-all.rkt ++dir pkgs
++dir native-pkgs --save main-distribution plt-services racket-lib
Linking packages:
  plt-services
  racket-lib
  main-distribution
Recording packages choice in racket/etc/link-pkgs.rktd
Finding packages
link-all: requested package not available: draw-x86_64-macosx-2
  context...:
   /Users/dvanhorn/git/racket/racket/src/link-all.rkt:155:6: for-loop
   /Users/dvanhorn/git/racket/racket/src/link-all.rkt:153:2: loop
   /Users/dvanhorn/git/racket/racket/src/link-all.rkt: [running body]
make[2]: *** [pkg-links] Error 1
make[1]: *** [plain-in-place] Error 2
make: *** [in-place] Error 2

Any ideas how to fix this?

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


Re: [racket-dev] requested package not available: draw-x86_64-macosx-2

2014-05-03 Thread Robby Findler
Just a guess but maybe git submodule update?

On Saturday, May 3, 2014, David Van Horn dvanh...@cs.umd.edu wrote:

 I just did a git pull and make and get the following error:

 racket/bin/racket -U -G build/config racket/src/link-all.rkt ++dir pkgs
 ++dir native-pkgs --save main-distribution plt-services racket-lib
 Linking packages:
   plt-services
   racket-lib
   main-distribution
 Recording packages choice in racket/etc/link-pkgs.rktd
 Finding packages
 link-all: requested package not available: draw-x86_64-macosx-2
   context...:
/Users/dvanhorn/git/racket/racket/src/link-all.rkt:155:6: for-loop
/Users/dvanhorn/git/racket/racket/src/link-all.rkt:153:2: loop
/Users/dvanhorn/git/racket/racket/src/link-all.rkt: [running body]
 make[2]: *** [pkg-links] Error 1
 make[1]: *** [plain-in-place] Error 2
 make: *** [in-place] Error 2

 Any ideas how to fix this?

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

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


Re: [racket-dev] requested package not available: draw-x86_64-macosx-2

2014-05-03 Thread David Van Horn
On 5/3/14, 3:36 PM, Robby Findler wrote:
 Just a guess but maybe git submodule update?

I always forget that step -- yes, that fixed it.  Thanks!

David


 On Saturday, May 3, 2014, David Van Horn dvanh...@cs.umd.edu wrote:
 
 I just did a git pull and make and get the following error:

 racket/bin/racket -U -G build/config racket/src/link-all.rkt ++dir pkgs
 ++dir native-pkgs --save main-distribution plt-services racket-lib
 Linking packages:
   plt-services
   racket-lib
   main-distribution
 Recording packages choice in racket/etc/link-pkgs.rktd
 Finding packages
 link-all: requested package not available: draw-x86_64-macosx-2
   context...:
/Users/dvanhorn/git/racket/racket/src/link-all.rkt:155:6: for-loop
/Users/dvanhorn/git/racket/racket/src/link-all.rkt:153:2: loop
/Users/dvanhorn/git/racket/racket/src/link-all.rkt: [running body]
 make[2]: *** [pkg-links] Error 1
 make[1]: *** [plain-in-place] Error 2
 make: *** [in-place] Error 2

 Any ideas how to fix this?

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

 

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


Re: [racket-dev] Enhancement to the syntax system?

2014-05-03 Thread Marijn Schouten (hkBst)
On 07/10/2012 05:03 PM, Matthew Flatt wrote:
 At Tue, 10 Jul 2012 10:51:57 -0400, Eli Barzilay wrote:
 20 minutes ago, Marijn wrote:

 It seems to me that both these results cannot be correct
 simultaneously, but I'll await the experts' opinion on that.

 This does look weird:

   #lang racket
   (define-for-syntax (f stx) #`(let ([x 1]) #,stx))
   (define-syntax (m stx)
 (with-syntax ([zz (f #'x)]) #`(let ([x 2]) zz)))
   (m)

 evaluates to 1, but if I change the first two stx names into x
 *or* if I change the argument name for the macro to x, then it
 returns 2.
 
 It's natural --- but not correct --- to think that #` is responsible
 for hygiene, in which case `(f #'x)' should keep the given `x' separate
 from the `let'-bound `x' in the result.
 
 Instead, hygiene is the responsibility of macro invocation, and
 
  #`(let ([x 1]) #,#'x)
 
 is simply the same as
 
  #`(let ([x 1]) x)
 
 and so
 
  (f #'x)
 
 above is equivalent to
 
  #`(let ([x 1]) x)

IIUC then you're saying that also all the following (fx #'x) and (fy
#'x) are equivalent to #`(let ((x 0)) x), but if you run this code then
you will get a 0 result only for (myy), contrary to what I would expect
based on the above explanation.

#lang racket

(define-for-syntax (fx x) #`(let ((x 0)) #,x))
(define-for-syntax (fy y) #`(let ((x 0)) #,y))

(define-syntax (mxx x)
  (syntax-case x () ((_) #`(let ((x 99)) #,(fx #'x)

(define-syntax (mxy x)
  (syntax-case x () ((_) #`(let ((x 99)) #,(fy #'x)

(define-syntax (myx y)
  (syntax-case y () ((_) #`(let ((x 99)) #,(fx #'x)

(define-syntax (myy y)
  (syntax-case y () ((_) #`(let ((x 99)) #,(fy #'x)

(mxx)
(mxy)
(myx)
(myy)

==

99
99
99
0

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