Re: [racket-dev] Plot testing and feedback

2011-08-14 Thread Matthew Flatt
At Fri, 12 Aug 2011 19:47:43 -0700, Neil Toronto wrote:
 Thank you! I blame, in order:
 
 1. Racket's awesome cross-platform drawing library. Holy cow! Making 
 nice plots would be next to impossible without it. Also, the fact that I 
 can render to ps/pdf/svg just by passing a different dc is wicked cool. 
 It even does alpha! In a PDF! How about that?

The credit here goes to Cairo (cairographics.org), which is the
back-end for dc drawing. In the old (pre-v5.1) days, we had our own
library that worked ok, but Cairo works much better.

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


Re: [racket-dev] Download link

2011-08-14 Thread Noel Welsh
On Sun, Aug 14, 2011 at 2:39 AM, Eli Barzilay e...@barzilay.org wrote:
 One option is a
 geoip database that could be used in JS (but all I found was expensive
 stuff), and another option is to find some known distribution network
 that does this kind of thing by itself (but again, all I found were
 things that are very ad-intense).

Free GeoIP database:

http://www.maxmind.com/app/geolitecountry

I don't know any free content distribution networks, but I haven't
really looked.

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


[racket-dev] Running into phase-error issues

2011-08-14 Thread Danny Yoo
I'm running into some problem when using dynamic-require-for-syntax:
if the module I'm requiring itself requires another module, I
inevitably hit the following error:

;;;
dyoo@thunderclap:~/phase-error$ racket query.rkt
link: reference (phase 1) to a variable in module
/home/dyoo/phase-error/structs.rkt that is uninitialized (phase
level 0); reference appears in module:
/home/dyoo/phase-error/record.rkt in: resource1.1

 === context ===
/home/dyoo/phase-error/record.rkt: [running body]
/home/dyoo/phase-error/query.rkt: [running body]
;;;


I don't know if I'm just doing something silly or not, so I haven't
submitted this as a bug report yet.  To reproduce, untar:

 http://hashcollision.org/tmp/phase-error.tar.gz

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


Re: [racket-dev] Running into phase-error issues

2011-08-14 Thread Matthew Flatt
At Sun, 14 Aug 2011 19:46:46 -0400, Danny Yoo wrote:
 I'm running into some problem when using dynamic-require-for-syntax:

I imagine the problem is that `dynamic-require-for-syntax' is broken,
but I hope to get rid of that function because it implements bad
phase-crossing behavior.

So, although it doesn't directly address the problem, can you say more
about why you want to use `dynamic-require-for-syntax'?


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


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

2011-08-14 Thread Robby Findler
On Sun, Aug 14, 2011 at 9:29 PM,  matth...@racket-lang.org wrote:
 collects/lang/htdp-langs-save-file-prefix.rkt
 ~
 --- OLD/collects/lang/htdp-langs-save-file-prefix.rkt
 +++ NEW/collects/lang/htdp-langs-save-file-prefix.rkt
 @@ -1,11 +1,16 @@
  #lang racket/base
 -(require racket/contract
 +
 +;; 
 ---
 +;; exports the header for a file saved from a drracket buffer in a 
 menu-selected teaching language
 +
 +(require racket/contract
          racket/port)

The above stuff is explained in the documentation, no? (If you think
it wasn't clear enough, then an edit belongs in the docs, not here,
imo)

Thanks for the fix below.

  (provide/contract
  [htdp-save-file-prefix (listof string?)]
  [htdp-file-prefix? (- input-port? boolean?)])

 +
  (define htdp-save-file-prefix
   (list ;; The first three lines of this file were inserted by DrRacket. 
 They record metadata
         ;; about the language level of this file in a form that our tools 
 can easily process.))
 @@ -27,8 +32,7 @@
     (cond
       [(null? prefix)
        (define l (read-line port 'any))
 -       (and (string? l)
 -            (regexp-match #rx^#reader l))]
 +       (and (string? l) (pair? (regexp-match #rx^#reader l)))]
       [else
        (define l (read-line port 'any))
        (and (string? l)


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

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

2011-08-14 Thread Matthias Felleisen

I am following the guidelines now :-) 

I actually do think a one-line purpose statement per module is a *good* idea. 


On Aug 14, 2011, at 10:46 PM, Robby Findler wrote:

 On Sun, Aug 14, 2011 at 9:29 PM,  matth...@racket-lang.org wrote:
 collects/lang/htdp-langs-save-file-prefix.rkt
 ~
 --- OLD/collects/lang/htdp-langs-save-file-prefix.rkt
 +++ NEW/collects/lang/htdp-langs-save-file-prefix.rkt
 @@ -1,11 +1,16 @@
  #lang racket/base
 -(require racket/contract
 +
 +;; 
 ---
 +;; exports the header for a file saved from a drracket buffer in a 
 menu-selected teaching language
 +
 +(require racket/contract
  racket/port)
 
 The above stuff is explained in the documentation, no? (If you think
 it wasn't clear enough, then an edit belongs in the docs, not here,
 imo)
 
 Thanks for the fix below.
 
  (provide/contract
  [htdp-save-file-prefix (listof string?)]
  [htdp-file-prefix? (- input-port? boolean?)])
 
 +
  (define htdp-save-file-prefix
   (list ;; The first three lines of this file were inserted by DrRacket. 
 They record metadata
 ;; about the language level of this file in a form that our tools 
 can easily process.))
 @@ -27,8 +32,7 @@
 (cond
   [(null? prefix)
(define l (read-line port 'any))
 -   (and (string? l)
 -(regexp-match #rx^#reader l))]
 +   (and (string? l) (pair? (regexp-match #rx^#reader l)))]
   [else
(define l (read-line port 'any))
(and (string? l)
 


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


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

2011-08-14 Thread Robby Findler
Unless it is about the _implementation_ of the module, I think that
belongs in the first paragraph of the docs instead.

Robby

On Sun, Aug 14, 2011 at 9:48 PM, Matthias Felleisen
matth...@ccs.neu.edu wrote:

 I am following the guidelines now :-)

 I actually do think a one-line purpose statement per module is a *good* idea.


 On Aug 14, 2011, at 10:46 PM, Robby Findler wrote:

 On Sun, Aug 14, 2011 at 9:29 PM,  matth...@racket-lang.org wrote:
 collects/lang/htdp-langs-save-file-prefix.rkt
 ~
 --- OLD/collects/lang/htdp-langs-save-file-prefix.rkt
 +++ NEW/collects/lang/htdp-langs-save-file-prefix.rkt
 @@ -1,11 +1,16 @@
  #lang racket/base
 -(require racket/contract
 +
 +;; 
 ---
 +;; exports the header for a file saved from a drracket buffer in a 
 menu-selected teaching language
 +
 +(require racket/contract
          racket/port)

 The above stuff is explained in the documentation, no? (If you think
 it wasn't clear enough, then an edit belongs in the docs, not here,
 imo)

 Thanks for the fix below.

  (provide/contract
  [htdp-save-file-prefix (listof string?)]
  [htdp-file-prefix? (- input-port? boolean?)])

 +
  (define htdp-save-file-prefix
   (list ;; The first three lines of this file were inserted by DrRacket. 
 They record metadata
         ;; about the language level of this file in a form that our tools 
 can easily process.))
 @@ -27,8 +32,7 @@
     (cond
       [(null? prefix)
        (define l (read-line port 'any))
 -       (and (string? l)
 -            (regexp-match #rx^#reader l))]
 +       (and (string? l) (pair? (regexp-match #rx^#reader l)))]
       [else
        (define l (read-line port 'any))
        (and (string? l)




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

Re: [racket-dev] Running into phase-error issues

2011-08-14 Thread Danny Yoo
 I'm running into some problem when using dynamic-require-for-syntax:

 I imagine the problem is that `dynamic-require-for-syntax' is broken,
 but I hope to get rid of that function because it implements bad
 phase-crossing behavior.

 So, although it doesn't directly address the problem, can you say more
 about why you want to use `dynamic-require-for-syntax'?



Yes!  Here's the problem I'm trying to solve:  I'm trying to attach
information to a module, and then be able to query for that
information without running the module.  I'm basically trying to
implement:


http://hashcollision.org/whalesong/#(part._.Including_external_resources_with__planet_dyoo_whalesong_1_2_resource_)


I'm approaching this problem by:

   * attaching that information as a compile-time begin-for-syntax.

   * querying for that information with a a dynamic-require-for-syntax
to invoke the begin-for-syntax.


As an implementation of this, see the files in:

   https://github.com/dyoo/whalesong/blob/master/resource/

I'm working around the bug by avoiding the require
(https://github.com/dyoo/whalesong/commit/e6547a9aa21402646814f562da6ba99b16a585a0),
but this is certainly fragile.

I want to do the Right Thing, but I don't know how yet.  :)
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Running into phase-error issues

2011-08-14 Thread Carl Eastlund
I've run into the same issue.  The way I sometimes to it is to eval
code which requires the original module for syntax, extracts the value
during macro expansion, and produces an expression that quotes it (or
an expression that reconstructs it, if not an s-expression).

Carl Eastlund



On Sun, Aug 14, 2011 at 11:32 PM, Danny Yoo d...@cs.wpi.edu wrote:
 I'm running into some problem when using dynamic-require-for-syntax:

 I imagine the problem is that `dynamic-require-for-syntax' is broken,
 but I hope to get rid of that function because it implements bad
 phase-crossing behavior.

 So, although it doesn't directly address the problem, can you say more
 about why you want to use `dynamic-require-for-syntax'?



 Yes!  Here's the problem I'm trying to solve:  I'm trying to attach
 information to a module, and then be able to query for that
 information without running the module.  I'm basically trying to
 implement:

    
 http://hashcollision.org/whalesong/#(part._.Including_external_resources_with__planet_dyoo_whalesong_1_2_resource_)


 I'm approaching this problem by:

   * attaching that information as a compile-time begin-for-syntax.

   * querying for that information with a a dynamic-require-for-syntax
 to invoke the begin-for-syntax.


 As an implementation of this, see the files in:

   https://github.com/dyoo/whalesong/blob/master/resource/

 I'm working around the bug by avoiding the require
 (https://github.com/dyoo/whalesong/commit/e6547a9aa21402646814f562da6ba99b16a585a0),
 but this is certainly fragile.

 I want to do the Right Thing, but I don't know how yet.  :)
 _
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


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