Re: [racket-users] syntax-parse and optional keywords

2015-04-17 Thread Alexander D. Knauth
There are several ways to do this, and they each have their uses depending on what you want to do with it. One is with a syntax-class: #lang racket (require syntax/parse) (define-splicing-syntax-class my-keyword [pattern (~seq #:my-keyword) #:attr kw #t] [pattern (~seq) #:attr kw #f])

Re: [racket-users] prop:procedure, prop:match-expander, and contract blame

2015-04-16 Thread Alexander D. Knauth
On Apr 15, 2015, at 2:29 PM, Jon Zeppieri zeppi...@gmail.com wrote: I'm trying to provide a struct, the struct type of which uses prop:procedure and prop:match-expander, and I'd like the procedure to have a contract. On Apr 15, 2015, at 10:12 PM, Jon Zeppieri zeppi...@gmail.com wrote:

Re: [racket-users] modifying readtable entry for `(` breaks reading #hash() ?

2015-04-16 Thread Alexander D. Knauth
Flatt wrote: At Tue, 14 Apr 2015 21:04:38 -0400, Alexander D. Knauth wrote: On Apr 14, 2015, at 6:57 PM, Matthew Flatt mfl...@cs.utah.edu wrote: This is the kind of problem that the readtable argument to `read/recursive` was meant to solve, but I see that it doesn't work in this case. I

Re: [racket-users] prop:procedure, prop:match-expander, and contract blame

2015-04-15 Thread Alexander D. Knauth
On Apr 15, 2015, at 10:12 PM, Jon Zeppieri zeppi...@gmail.com wrote: On Wed, Apr 15, 2015 at 9:35 PM, Alexander D. Knauth alexan...@knauth.org wrote: On Apr 15, 2015, at 2:29 PM, Jon Zeppieri zeppi...@gmail.com wrote: I'm trying to provide a struct, the struct type of which uses

Re: [racket-users] DrRacket freezes from background expansion with typed racket file in pict3d

2015-04-14 Thread Alexander D. Knauth
I did try that, but no. On Apr 14, 2015, at 3:03 AM, Robby Findler ro...@eecs.northwestern.edu wrote: Do you see a message appearing in stdout of DrRacket? (It would be in console.app on a Mac.) Robby On Monday, April 13, 2015, Alexander D. Knauth alexan...@knauth.org wrote: DrRacket

Re: [racket-users] DrRacket freezes from background expansion with typed racket file in pict3d

2015-04-14 Thread Alexander D. Knauth
/shape/polygon.rkt:490:21: Type Checker: Summary: 2 errors encountered in: time time I guess you see something else? On Tue, Apr 14, 2015 at 5:31 AM, Alexander D. Knauth alexan...@knauth.org wrote: I did try that, but no. On Apr 14, 2015, at 3:03 AM, Robby Findler ro

Re: [racket-users] modifying readtable entry for `(` breaks reading #hash() ?

2015-04-14 Thread Alexander D. Knauth
) is easy enough to add, but the result isn't pretty and it doesn't seem much more general. Does it sound useful enough to you? At Mon, 13 Apr 2015 16:51:45 -0400, Alexander D. Knauth wrote: Ok, I guess that makes sense. I do have `(` mapped to something other than the default

Re: [racket-users] DrRacket freezes from background expansion with typed racket file in pict3d

2015-04-14 Thread Alexander D. Knauth
PM, Alexander D. Knauth alexan...@knauth.org wrote: Or a simpler way of achieving the same thing would be to replace the `time`s in pict3d/private/engine/shape/polygon.rk that were giving you errors, with `(cast time Nonnegative-Flonum)`, but when I do that, it works fine. On Apr 14

Re: [racket-users] Code Generation

2015-04-14 Thread Alexander D. Knauth
On Apr 14, 2015, at 7:08 PM, Héctor Mc soulras...@gmail.com wrote: Hey community In advance sorry for the english, don't speak the language. I'm student and begin to work the thesis and chose to do it in racket. It's about a code generator of web aplications (prototype). The problem that

Re: [racket-users] DrRacket freezes from background expansion with typed racket file in pict3d

2015-04-14 Thread Alexander D. Knauth
Checker: Summary: 2 errors encountered in: time time On Apr 14, 2015, at 5:15 PM, Alexander D. Knauth alexan...@knauth.org wrote: It says, version 6.2.0.2--2015-04-07(23ec573/a) [3m], but I also updated the drracket, gui-lib, and scribble-lib pkgs from the github repos since then to get

Re: [racket-users] DrRacket freezes from background expansion with typed racket file in pict3d

2015-04-14 Thread Alexander D. Knauth
. Can you say more about exactly which version of drracket you're using and how you installed pict3d? Robby On Tue, Apr 14, 2015 at 3:20 PM, Alexander D. Knauth alexan...@knauth.org wrote: I open DrRacket, then open pict3d/private/gui/typed-pict3d-combinators.rkt, and then I wait a few

Re: [racket-users] DrRacket freezes from background expansion with typed racket file in pict3d

2015-04-14 Thread Alexander D. Knauth
Or a simpler way of achieving the same thing would be to replace the `time`s in pict3d/private/engine/shape/polygon.rk that were giving you errors, with `(cast time Nonnegative-Flonum)`, but when I do that, it works fine. On Apr 14, 2015, at 5:43 PM, Alexander D. Knauth alexan...@knauth.org

Re: [racket-users] modifying readtable entry for `(` breaks reading #hash() ?

2015-04-13 Thread Alexander D. Knauth
(make-readtable #f #\! #\( #f)]) (read (open-input-string #hash!!x . 1) So, the issue in your example is that `(` is mapped to something other than the default meaning of `(`. At Mon, 13 Apr 2015 16:20:04 -0400, Alexander D. Knauth wrote: But if it does that, then why should

[racket-users] DrRacket freezes from background expansion with typed racket file in pict3d

2015-04-13 Thread Alexander D. Knauth
DrRacket is freezing on me a lot, but I’m not sure if it’s because of a problem in DrRacket, Typed Racket, Pict3d, or something else. If I open DrRacket, open pict3d/private/gui/typed-pict3d-combinators.rkt, which is a typed racket file, with background expansion turned on, if I wait a few

Re: [racket-users] modifying readtable entry for `(` breaks reading #hash() ?

2015-04-13 Thread Alexander D. Knauth
] It's difficult to say just how much those things matter, and there are trade-offs in flexibility and error reporting, but that's why the reader works the way it does currently. At Sun, 12 Apr 2015 08:54:16 -0400, Alexander D. Knauth wrote: For something like this: #lang racket (define orig

[racket-users] modifying readtable entry for `(` breaks reading #hash() ?

2015-04-12 Thread Alexander D. Knauth
For something like this: #lang racket (define orig-readtable (current-readtable)) (parameterize ([current-readtable (make-readtable orig-readtable #\( 'terminating-macro (λ (c in src ln col pos)

Re: [racket-users] question about read/recursive

2015-04-11 Thread Alexander D. Knauth
the immediate `$` behave like `@` without affecting other `$`s within the parentheses. At Sat, 11 Apr 2015 11:40:57 -0400, Alexander D. Knauth wrote: For this: #lang racket/base (require scribble/reader) (read/recursive (open-input-string (@x)) #f (make-at-readtable)) I expected it to produce

[racket-users] question about read/recursive

2015-04-11 Thread Alexander D. Knauth
For this: #lang racket/base (require scribble/reader) (read/recursive (open-input-string (@x)) #f (make-at-readtable)) I expected it to produce ‘(x), but instead it produces ‘(@x). Is this a bug, or is this just not what read/recursive was intended for, or ? -- You received this message

Re: [racket-users] DrRacket blue info box for unfinished forms?

2015-04-11 Thread Alexander D. Knauth
that and some interactivity improvements. It now looks backwards for a symbol so if you type ahead by a few parens and spaces, it'll still pick up the keyword. (It may be a while before the pkg server updates.) Robby On Tue, Apr 7, 2015 at 9:18 PM, Alexander D. Knauth alexan...@knauth.org

Re: [racket-users] DrRacket blue info box for unfinished forms?

2015-04-07 Thread Alexander D. Knauth
I downloaded the new snapshot as soon as I could to try it out. Thank you! This is my new favorite thing about DrRacket! On Apr 7, 2015, at 7:55 AM, Robby Findler ro...@eecs.northwestern.edu wrote: If you have a recent snapshot build then you can say raco pkg update drracket. It should

Re: [racket-users] DrRacket blue info box for unfinished forms?

2015-04-07 Thread Alexander D. Knauth
Now I’m wondering: would you be able to extend this to the repl in the interactions panel? On Apr 6, 2015, at 6:46 PM, Robby Findler ro...@eecs.northwestern.edu wrote: I've just pushed a change to DrRacket to do that. Thanks for the prompting; it helped me realize a better approach than what

[racket-users] sequence/c turns streams into non-stream sequences?

2015-04-06 Thread Alexander D. Knauth
I was running into a problem with using streams in typed racket, where I was using the Sequenceof type to represent streams, and they got turned into non-stream sequences, which don’t work for stream-specific operations. I think what's causing it is this: #lang racket (define/contract my-stream

Re: [racket-users] Questions: free-identifier=?; literal-id in syntax-case

2015-04-04 Thread Alexander D. Knauth
On Apr 4, 2015, at 11:22 AM, Jos Koot jos.k...@gmail.com wrote: The following puzzles me: #lang racket (define plus +) (free-identifier=? #'+ #'plus) ; - #f #lang racket (define-syntax (a stx) (syntax-case stx () ((_) (datum-syntax stx (free-identifier=? #'+ #'plus) (define

[racket-users] a syntax-class that can get the var-id it was used with?

2015-04-04 Thread Alexander D. Knauth
Is there a way to define a syntax-class so that for example in: (syntax-parse stx [(_ a:stxcls) ….]) It would be able to know that it was used with a, instead of for instance b in b:stxcls? Is that possible? If not, would it be a good idea to add? The reason I ask is that then it might be

Re: [racket-users] eval and set

2015-04-04 Thread Alexander D. Knauth
On Apr 4, 2015, at 5:26 PM, Erik Silkensen eriksilken...@gmail.com wrote: Could someone explain how this example works? $ racket Welcome to Racket v6.1.1. - (require racket/sandbox) - (define racket-eval (make-evaluator 'racket)) - (define a (racket-eval '(set 1 2 3))) - a (set 1 2 3)

Re: [racket-users] advice for writing desktop app

2015-04-03 Thread Alexander D. Knauth
On Apr 3, 2015, at 4:40 AM, Gour g...@atmarama.net wrote: I've found the following: Sadly, RacketGUI lacks some advanced controls I often want: trees tables containing controls in cells However the list-box% control supports cells that only contain text. tree-tables “

Re: [racket-users] advice for writing desktop app

2015-04-03 Thread Alexander D. Knauth
On Apr 3, 2015, at 8:56 AM, Alexander D. Knauth alexan...@knauth.org wrote: On Apr 3, 2015, at 4:40 AM, Gour g...@atmarama.net wrote: I've found the following: Sadly, RacketGUI lacks some advanced controls I often want: trees tables containing controls in cells However

[racket-users] raco test doesn't run configure-runtime?

2015-03-30 Thread Alexander D. Knauth
For my exact-decimal meta-language, I had some tests that depend on the read-decimal-as-inexact parameter being set to #f by configure-runtime. It seems like raco test isn’t running that before running the tests. Is that intentional? (by the way the tests are not within a test submodule) --

Re: [racket-users] raco test doesn't run configure-runtime?

2015-03-30 Thread Alexander D. Knauth
On Mar 30, 2015, at 10:16 PM, Robby Findler ro...@eecs.northwestern.edu wrote: On Monday, March 30, 2015, Alexander D. Knauth alexan...@knauth.org wrote: Well the point of using the configure-runtime was that it would run when it was the “main program so that exact-decimals would work

Re: [racket-users] raco test doesn't run configure-runtime?

2015-03-30 Thread Alexander D. Knauth
think you can use that facility to implement the exact-decimal language. Robby On Mon, Mar 30, 2015 at 8:56 PM, Alexander D. Knauth alexan...@knauth.org wrote: For my exact-decimal meta-language, I had some tests that depend on the read-decimal-as-inexact parameter being set to #f

Re: [racket-users] changing REPL Language in TryRacket

2015-03-28 Thread Alexander D. Knauth
On Mar 28, 2015, at 8:02 AM, Alexander D. Knauth alexan...@knauth.org wrote: Oh. I forgot that try-racket didn’t call current-print within the sandbox. In that case maybe you could, in addition, change this line: https://github.com/jarcane/try-racket/blob/master/main.rkt#L75

Re: [racket-users] changing REPL Language in TryRacket

2015-03-27 Thread Alexander D. Knauth
) and not '(1 2 3) or (mcons 1( mcons 2... Just like DrRacket in r5rs language do! Any idea what to do? Sent from my iPhone On 28 Mar 2015, at 00:44, Alexander D. Knauth alexan...@knauth.org wrote: Does this changing this line to `(make-evaluator ‘(special r5rs)` do what you want? https

Re: [racket-users] changing REPL Language in TryRacket

2015-03-27 Thread Alexander D. Knauth
On Mar 27, 2015, at 8:51 PM, Alexander D. Knauth alexan...@knauth.org wrote: Does changing it do this do what you want? (make-evaluator '(special r5rs) '(require r5rs/init) And I forgot, also add a [current-print write] to the parameterize form? On Mar 27, 2015, at 8:26 PM, Chrakhan

Re: [racket-users] changing REPL Language in TryRacket

2015-03-27 Thread Alexander D. Knauth
Does this changing this line to `(make-evaluator ‘(special r5rs)` do what you want? https://github.com/jarcane/try-racket/blob/master/main.rkt#L53 On Mar 27, 2015, at 6:44 PM, Chrakhan Barzanji chrakhan.barza...@gmail.com wrote: hi, as you may know in TryRacket the language of the REPL is

<    1   2