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

2010-06-26 Thread Jay McCarthy
Just using the core of even-read didn't work. It would start to read
after parse-statement had returned and then my parser would just sit
there because the port wasn't returning EOF. I think it is a bug.

Jay

On Fri, Jun 25, 2010 at 10:44 PM, Eli Barzilay e...@barzilay.org wrote:
 On Jun 26, j...@racket-lang.org wrote:
 +  ; XXX This is almost certainly wrong.
 +  (define (even-read src ip)
 +    (begin0
 +      (parameterize ([current-source-name src])
 +       (datum-syntax #f (parse-statement ip)))
 +      (current-read-interaction odd-read)))
 +  (define (odd-read src ip)
 +    (current-read-interaction even-read)
 +    eof)
 +
 +  (current-read-interaction
 +   even-read))

 This is not just wrong -- it is likely to break things randomly.
 Something like -- if you happen to invoke the datalog reader
 indirectly (like just `read' a file in the language), you'd end up
 with one of these readers as a side-effect.  This is exactly how the
 scribble/text language messed things up in a very confusing way: by
 banging `current-print' to do its own thing.

 --
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!




-- 
Jay McCarthy j...@cs.byu.edu
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

The glory of God is Intelligence - DC 93
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

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

2010-06-26 Thread Robby Findler
It should be set by the 'configure-runtime thunk (from
module-language-info), right?

(I'm not sure about the bug, tho.)

Robby

On Sat, Jun 26, 2010 at 8:47 AM, Jay McCarthy jay.mccar...@gmail.com wrote:
 Just using the core of even-read didn't work. It would start to read
 after parse-statement had returned and then my parser would just sit
 there because the port wasn't returning EOF. I think it is a bug.

 Jay

 On Fri, Jun 25, 2010 at 10:44 PM, Eli Barzilay e...@barzilay.org wrote:
 On Jun 26, j...@racket-lang.org wrote:
 +  ; XXX This is almost certainly wrong.
 +  (define (even-read src ip)
 +    (begin0
 +      (parameterize ([current-source-name src])
 +       (datum-syntax #f (parse-statement ip)))
 +      (current-read-interaction odd-read)))
 +  (define (odd-read src ip)
 +    (current-read-interaction even-read)
 +    eof)
 +
 +  (current-read-interaction
 +   even-read))

 This is not just wrong -- it is likely to break things randomly.
 Something like -- if you happen to invoke the datalog reader
 indirectly (like just `read' a file in the language), you'd end up
 with one of these readers as a side-effect.  This is exactly how the
 scribble/text language messed things up in a very confusing way: by
 banging `current-print' to do its own thing.

 --
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!




 --
 Jay McCarthy j...@cs.byu.edu
 Assistant Professor / Brigham Young University
 http://teammccarthy.org/jay

 The glory of God is Intelligence - DC 93
 _
  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] [plt] Push #20578: master branch updated

2010-06-26 Thread Jay McCarthy
You are right. I used it and it works. Nice!

Jay

On Sat, Jun 26, 2010 at 4:58 PM, Robby Findler
ro...@eecs.northwestern.edu wrote:
 It should be set by the 'configure-runtime thunk (from
 module-language-info), right?

 (I'm not sure about the bug, tho.)

 Robby

 On Sat, Jun 26, 2010 at 8:47 AM, Jay McCarthy jay.mccar...@gmail.com wrote:
 Just using the core of even-read didn't work. It would start to read
 after parse-statement had returned and then my parser would just sit
 there because the port wasn't returning EOF. I think it is a bug.

 Jay

 On Fri, Jun 25, 2010 at 10:44 PM, Eli Barzilay e...@barzilay.org wrote:
 On Jun 26, j...@racket-lang.org wrote:
 +  ; XXX This is almost certainly wrong.
 +  (define (even-read src ip)
 +    (begin0
 +      (parameterize ([current-source-name src])
 +       (datum-syntax #f (parse-statement ip)))
 +      (current-read-interaction odd-read)))
 +  (define (odd-read src ip)
 +    (current-read-interaction even-read)
 +    eof)
 +
 +  (current-read-interaction
 +   even-read))

 This is not just wrong -- it is likely to break things randomly.
 Something like -- if you happen to invoke the datalog reader
 indirectly (like just `read' a file in the language), you'd end up
 with one of these readers as a side-effect.  This is exactly how the
 scribble/text language messed things up in a very confusing way: by
 banging `current-print' to do its own thing.

 --
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!




 --
 Jay McCarthy j...@cs.byu.edu
 Assistant Professor / Brigham Young University
 http://teammccarthy.org/jay

 The glory of God is Intelligence - DC 93
 _
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev




-- 
Jay McCarthy j...@cs.byu.edu
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

The glory of God is Intelligence - DC 93
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev