Re: [racket-dev] provide expand-clause in racket/private/for.rkt

2013-09-06 Thread Matthew Flatt
As far as I can see, exporting `expand-clause` is ok. Ideally, I think it should be exported from a new `racket/for-transform` library, instead of used directly from `racket/private/for`. Also, `expand-for-clause` might be a better name. At Fri, 6 Sep 2013 00:45:40 -0400, Stephen Chang wrote:

Re: [racket-dev] Module Browser not a plugin/tool

2013-09-06 Thread Stephen De Gabrielle
Hi, I just tried making a instance of insert-large-letters as a tool. I just copied the code and added the tools stuff. Seemed to work OK, but - I turned it into normal racket as I didn't have time to learn typed racket. - I'm not confident enough with the core of DrRacket to remove the

Re: [racket-dev] Module Browser not a plugin/tool

2013-09-06 Thread Stephen De Gabrielle
Ugh - the list scrubbed my attachments. I'm guessing my options are to submit pull request or make a planet package. s. On Fri, Sep 6, 2013 at 2:00 PM, Stephen De Gabrielle stephen.degabrie...@acm.org wrote: Hi, I just tried making a instance of insert-large-letters as a tool. I just

Re: [racket-dev] Module Browser not a plugin/tool

2013-09-06 Thread Robby Findler
I got the attachments, FWIW. Probably best, however, if someone were to submit a pull request with the code still in TR and with the appropriate removal of the current implementation. Otherwise, I think it has served its purpose as a learning experiment and that's seems excellent. Robby On Fri,

Re: [racket-dev] Module Browser not a plugin/tool

2013-09-06 Thread Stephen De Gabrielle
thanks. http://planet.racket-lang.org/display.ss?package=insert-large-letters.pltowner=spdegabrielle -- Stephen De Gabrielle http://www.degabrielle.name/stephen On Fri, Sep 6, 2013 at 2:35 PM, Robby Findler ro...@eecs.northwestern.eduwrote: I got the attachments, FWIW. Probably best,

Re: [racket-dev] split-for-body from syntax/for-body

2013-09-06 Thread Matthew Flatt
#lang racket/base (require (for-syntax racket/base syntax/parse syntax/for-body)) (define-syntax (for/print/good stx) (syntax-parse stx [(_ clauses . body) (with-syntax ([([pre ...] [post ...]) (split-for-body stx #'body)]) (syntax

Re: [racket-dev] split-for-body from syntax/for-body

2013-09-06 Thread Stephen Chang
Among the bodys, besides stopping the iteration and preventing later body evaluations, a #:break guard-expr or #:final guard-expr clause starts a new internal-definition context. I had the same thought process as Carl. I now understand the behavior but I don't understand why it's needed? It

Re: [racket-dev] tests not being run?

2013-09-06 Thread David Vanderson
Ah - thank you! I think I finally understand how this works. To make sure, I query the props like this: ~/apps/racket$ ./pkgs/plt-services/meta/props get drdr:command-line pkgs/racket-pkgs/racket-test/tests/run-automated-tests.rkt mzc -k ~s This tells DrDr to make sure the file compiles

Re: [racket-dev] split-for-body from syntax/for-body

2013-09-06 Thread Carl Eastlund
They have to be separate internal definition contexts in order for #:break and #:final to be able to stop execution before the definitions themselves get run. Carl Eastlund On Fri, Sep 6, 2013 at 2:31 PM, Stephen Chang stch...@ccs.neu.edu wrote: Among the bodys, besides stopping the

Re: [racket-dev] provide expand-clause in racket/private/for.rkt

2013-09-06 Thread Stephen Chang
On Fri, Sep 6, 2013 at 7:54 AM, Matthew Flatt mfl...@cs.utah.edu wrote: As far as I can see, exporting `expand-clause` is ok. Ideally, I think it should be exported from a new `racket/for-transform` library, instead of used directly from `racket/private/for`. Also, `expand-for-clause` might

Re: [racket-dev] split-for-body from syntax/for-body

2013-09-06 Thread Stephen Chang
It's useful when the condition for loop termination and the value of the loop body both depend on some derived computation from the sequence elements: (for/list ([x (in-stream S)]) (define y (f x)) #:break (g? y) (h y)) Ok I see, thanks. It does make things easier to read when the

Re: [racket-dev] split-for-body from syntax/for-body

2013-09-06 Thread Carl Eastlund
Okay, I see what's going on here. It's very subtle though, and probably deserves some explanation in split-for-body's documentation. My first thought on seeing my non-fix version break here is that I can make split-for-body break the same way. The problem is that my non-fix separates the

Re: [racket-dev] provide expand-clause in racket/private/for.rkt

2013-09-06 Thread Matthew Flatt
Now that you've pushed this, it occurs to me why it's probably unsafe: some `in-...' forms expand to unsafe operations, right? If I'm right about that, then we should probably move the function to `racket/unsafe/for-transform' and protect the export. (Or, since I see that you put the library in

Re: [racket-dev] split-for-body from syntax/for-body

2013-09-06 Thread Carl Eastlund
On Fri, Sep 6, 2013 at 2:43 PM, Stephen Chang stch...@ccs.neu.edu wrote: On Fri, Sep 6, 2013 at 2:36 PM, Carl Eastlund c...@ccs.neu.edu wrote: They have to be separate internal definition contexts in order for #:break and #:final to be able to stop execution before the definitions

Re: [racket-dev] tests not being run?

2013-09-06 Thread Jay McCarthy
All correct On Fri, Sep 6, 2013 at 12:34 PM, David Vanderson david.vander...@gmail.comwrote: Ah - thank you! I think I finally understand how this works. To make sure, I query the props like this: ~/apps/racket$ ./pkgs/plt-services/meta/props get drdr:command-line

Re: [racket-dev] split-for-body from syntax/for-body

2013-09-06 Thread Carl Eastlund
Right, that's the issue with needing the (let () result) in my define-syntax-rule version. I still didn't need split-for-body, which doesn't guarantee there are no definitions in the post ... part. All it guarantees to eliminate are #:final and #:break. Carl Eastlund On Fri, Sep 6, 2013 at

Re: [racket-dev] split-for-body from syntax/for-body

2013-09-06 Thread Carl Eastlund
You're proving that (let () ...) is necessary, which I have explicitly agreed with since the original email, but you have not yet demonstrated that split-for-body is necessary. Here is the fix I have described twice already, now explicitly put into the define-syntax-rule solution:

[racket-dev] split-for-body from syntax/for-body

2013-09-06 Thread Carl Eastlund
Is this function ever particularly necessary? Its intended use seems to be like so: (define-syntax (for/print stx) (syntax-parse stx [(_ clauses . body) (with-syntax ([([pre ...] [post ...]) (split-for-body #'body)]) (syntax (for clauses pre ...

Re: [racket-dev] split-for-body from syntax/for-body

2013-09-06 Thread Matthew Flatt
Sorry that I forgot to add the `let` while turning the code you sent into a full example. Here's another try. #lang racket/base (require (for-syntax racket/base syntax/parse syntax/for-body)) (define-syntax (for/print/good stx) (syntax-parse stx