Re: [racket] syntax-parse #:at

2012-05-21 Thread Jon Rafkind
I think my confusion stems from the fact that the inner syntax-parse rebinds 'name' but the original source location is preserved so when I print out #'name in the 'make-transformer' macro I see that it still points at the original 'x'. When I print 'new-name' instead I see it has a source locat

[racket] Macro stepper expansion

2012-05-21 Thread Harry Spier
I've entered the following example from the Racket Guide into DrRacket #lang racket (define-syntax-rule (swap X Y) (let ([tmp X]) (set! X Y) (set! Y tmp))) (let ([tmp 5] [other 6]) (swap tmp other) (list tmp other)) It gives me the correct result: > '(6 5) But when I stepped thro

Re: [racket] help with scribble/manual

2012-05-21 Thread Danny Heap
Thank you, Danny: right both times. On Mon, May 21, 2012 at 05:00:08PM -0400, Danny Yoo wrote: > On Mon, May 21, 2012 at 3:36 PM, Danny Heap wrote: > > I am trying to include a small manual page with my (also small) > > PLaneT module.  Scribble doesn't see the bindings for the functions > > intro

Re: [racket] requiring in multiple phases

2012-05-21 Thread Matthew Flatt
I think there probably should not be a standard shortcut. You may well have a good reason for to import a module into multiple phases, but I think it usually indicates a code-organization problem (where code that needs to live at different phases has been lumped together at some level). Since it's

Re: [racket] Lazy Racket?

2012-05-21 Thread Matthias Felleisen
Do you mean something like this: #lang lazy (require racket/gui) (define f (new frame% [label "hello world"] [width 200] [height 200])) (define t (new button% [label "bye"] [parent f] [callback void])) (send f show #t) On May 21, 2012, at 9:49 PM, Michael Rice wrote: > I answered my ow

Re: [racket] syntax-parse #:at

2012-05-21 Thread Matthew Flatt
I don't understand your objections to the `printf' results, but I think I can now better explain your original problem. When the template has (syntax-parse stx [(_ new-name) (with-syntax ([output (make-transformer name pattern template)]) #'(define-syntax new-name output))]) t

Re: [racket] Lazy Racket?

2012-05-21 Thread Michael Rice
I answered my own question by looking at the language menu, I think. Michael On Mon, May 21, 2012 at 4:02 PM, Michael Rice wrote: > Can I get Racket's graphics capability with lazy Scheme? > > Michael > Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Is there a technical or social reason that parser-tools/lexer doesn't have an "else"?

2012-05-21 Thread Danny Yoo
> parser-tools/lex-sre has a sequence regular expression (:), which can > match an empty sequence. (It does warn you that it accepts an empty > sequence, since it's guaranteed to succeed, but it doesn't consume > input.) Yes, that's true. The documentation clearly knows this situation happens, an

Re: [racket] Is there a technical or social reason that parser-tools/lexer doesn't have an "else"?

2012-05-21 Thread Jon Zeppieri
On Mon, May 21, 2012 at 7:54 PM, Danny Yoo wrote: > I've been frustrated with trying to compose lexers together.  The > situation is that I'd like to define a lexer that knows how to give up > gracefully, and to give another lexer a go at processing a port. > > Ideally, I'd like to say something

Re: [racket] Audio input

2012-05-21 Thread Danny Yoo
> A couple of my students are toying with the idea of generating pseudorandom > numbers from ambient sources, and want to try using audio as a source. Perhaps John Clements' Portaudio bindings would be a platform-independent way to get sound from the microphone. http://planet.racket-lang.org/pac

[racket] Audio input

2012-05-21 Thread Jordan Johnson
Hi all, A couple of my students are toying with the idea of generating pseudorandom numbers from ambient sources, and want to try using audio as a source. They are doing it on Linux and not concerned about portability, and they just need to be able to grab some input on demand, so my initial of

[racket] Is there a technical or social reason that parser-tools/lexer doesn't have an "else"?

2012-05-21 Thread Danny Yoo
I've been frustrated with trying to compose lexers together. The situation is that I'd like to define a lexer that knows how to give up gracefully, and to give another lexer a go at processing a port. Ideally, I'd like to say something like this: ;

Re: [racket] Reading bibtex files

2012-05-21 Thread Norman Gray
Jay, hello. On 2012 May 21, at 23:01, Jay McCarthy wrote: > I'll get on it. As you know, BibTex is a very poorly described format. > It can parse my humongous Bibtex file, but I haven't spent a ton of > tiny searching for problematic ones in the wild. This discussion prompted me to find a relat

Re: [racket] Reading bibtex files

2012-05-21 Thread Laurent
On Tue, May 22, 2012 at 12:01 AM, Jay McCarthy wrote: > I'll get on it. As you know, BibTex is a very poorly described format. > It can parse my humongous Bibtex file, but I haven't spent a ton of > tiny searching for problematic ones in the wild. > It parses mine too, except mostly for one thing

Re: [racket] Reading bibtex files

2012-05-21 Thread Jay McCarthy
I'll get on it. As you know, BibTex is a very poorly described format. It can parse my humongous Bibtex file, but I haven't spent a ton of tiny searching for problematic ones in the wild. Jay On Mon, May 21, 2012 at 10:15 AM, Danny Yoo wrote: > On Mon, May 21, 2012 at 11:42 AM, Danny Yoo wrote:

Re: [racket] help with scribble/manual

2012-05-21 Thread Danny Yoo
On Mon, May 21, 2012 at 3:36 PM, Danny Heap wrote: > I am trying to include a small manual page with my (also small) > PLaneT module.  Scribble doesn't see the bindings for the functions > introduced in my module, judging by the warnings generated by 'raco > setup...' --- errors which are also gen

[racket] Lazy Racket?

2012-05-21 Thread Michael Rice
Can I get Racket's graphics capability with lazy Scheme? Michael Racket Users list: http://lists.racket-lang.org/users

[racket] help with scribble/manual

2012-05-21 Thread Danny Heap
I am trying to include a small manual page with my (also small) PLaneT module. Scribble doesn't see the bindings for the functions introduced in my module, judging by the warnings generated by 'raco setup...' --- errors which are also generated when the module is required from the PLanet repositor

Re: [racket] RacketCon 2012?

2012-05-21 Thread Neil Van Dyke
Vasishtha Spier wrote at 05/21/2012 02:12 PM: But most of all how to approach learning it if you have a project starting in the next few months. A reading list, and most of all prioritizing the different Racket and functional programming topics. What are the most important topics to learn befo

Re: [racket] requiring in multiple phases

2012-05-21 Thread Neil Van Dyke
I'm wondering whether there's a standard shortcut, and, if not, whether there should be. (I am pretty deep into macrology right now, hence the question. :) Jon Rafkind wrote at 05/21/2012 02:28 PM: (define-syntax-rule (require-for-all req ...) (require (for-meta -1 req ...) (for-meta 0 req ..

Re: [racket] Finite State Machines of Arbitrary Size using Racket's composable control

2012-05-21 Thread Galler
Marjin, my attempt at an answer: Yes, just the two-state machine is presented, but could be used for larger FSMs. And, yes, that would be the webserver that is provided with racket. In what way is this solution impossible without it? I represent the solution provides the following feature

Re: [racket] RacketCon 2012?

2012-05-21 Thread Eduardo Bellani
I would vote to see an emphasis on syntax manipulation and DSL on racket, as I see it as the great market differentiation for racket. On Wed, May 16, 2012 at 11:22 AM, Sam Tobin-Hochstadt wrote: > On Tue, May 15, 2012 at 2:12 PM, Scott Hickey wrote: >> Are there any plans for a RacketCon 2012? >

Re: [racket] requiring in multiple phases

2012-05-21 Thread Jon Rafkind
(define-syntax-rule (require-for-all req ...) (require (for-meta -1 req ...) (for-meta 0 req ...) (for-meta 1 req ...)) (require-for-all "a.rkt" "b.rkt" "c.rkt") should work afaik On 05/21/2012 11:39 AM, Neil Van Dyke wrote: > If I want to "require" a module for multiple phases, is there a short

Re: [racket] RacketCon 2012?

2012-05-21 Thread Vasishtha Spier
I'm not sure this is the right conference if its mostly for experienced Racketeers, but if its being video'ed it might still be useful. But I think it would be useful in some conference to have a talk on Racket for experienced imperative programmers. Why they should be using it. What advantages

[racket] requiring in multiple phases

2012-05-21 Thread Neil Van Dyke
If I want to "require" a module for multiple phases, is there a shortcut for that? For example, right now, I have this in a real-world file: (require (for-syntax racket/base syntax/parse "html-template-generate.rkt" "html-template-p

Re: [racket] syntax-parse #:at

2012-05-21 Thread Jon Rafkind
On 05/21/2012 10:06 AM, Jon Rafkind wrote: > On 05/21/2012 06:02 AM, Matthew Flatt wrote: >> At Sun, 20 May 2012 22:42:30 -0600, Jon Rafkind wrote: >>> The issue is why do I have to use a name other than 'name' for the >>> pattern variable on the line where it says 'HERE'. If I use the >>> 'name' p

Re: [racket] Reading bibtex files

2012-05-21 Thread Danny Yoo
On Mon, May 21, 2012 at 11:42 AM, Danny Yoo wrote: > I think there's a bug in the library.  There appears to be a missing > call to (slurp-whitespace ip) in the parsing library.  I'll send a bug > report and a patch to the Racket developers.  A diff follows below for > those who like looking at pa

Re: [racket] syntax-parse #:at

2012-05-21 Thread Jon Rafkind
On 05/21/2012 06:02 AM, Matthew Flatt wrote: > At Sun, 20 May 2012 22:42:30 -0600, Jon Rafkind wrote: >> The issue is why do I have to use a name other than 'name' for the >> pattern variable on the line where it says 'HERE'. If I use the >> 'name' pattern variable then the syntax-parse form genera

Re: [racket] Reading bibtex files

2012-05-21 Thread Laurent
Indeed, thank you all! It seems the lib is not very robust w.r.t. the very bad bibtex "standard". I think it should skip everything that does not begin with "@" outside entries, but instead wants only "@" and %-comments. Laurent On Mon, May 21, 2012 at 5:42 PM, Danny Yoo wrote: > I think there

Re: [racket] Reading bibtex files

2012-05-21 Thread Danny Yoo
I think there's a bug in the library. There appears to be a missing call to (slurp-whitespace ip) in the parsing library. I'll send a bug report and a patch to the Racket developers. A diff follows below for those who like looking at patch files. :) ##

Re: [racket] looking for a twitter library (or, failing that, OAuth 1.0)

2012-05-21 Thread Zachary Kanfer
Erik is correct -- if you download http://ycombinator.com/arc/arc3.1.tarinstead of arc3.tar, you can use Racket. The reason that Arc used to work only on MzScheme 372 is because of immutable conses. Eli Barzilay helped get Arc working with them: http://arclanguage.com/item?id=10254 On Mon, May 21

Re: [racket] Reading bibtex files

2012-05-21 Thread Luke Vilnis
If I delete all the newlines and spaces (aside from spaces around "=" signs) it works... Maybe there's some feature to ignore whitespace? On Mon, May 21, 2012 at 10:36 AM, Laurent wrote: > (replying to list) > > Thanks, that was a good idea, but conversion to unix format (I'm on linux) > did not

Re: [racket] Reading bibtex files

2012-05-21 Thread Laurent
(replying to list) Thanks, that was a good idea, but conversion to unix format (I'm on linux) did not help unfortunately. Now the message is "...got #\newline;..." instead. Laurent On Mon, May 21, 2012 at 4:28 PM, J. Ian Johnson wrote: > Not a user of this library, but this looks like a crlf i

Re: [racket] Help with simple macro

2012-05-21 Thread Eli Barzilay
On Wednesday, Harry Spier wrote: > [...] > but I've been unable to create a macro to create this form: > --- > (with-sequence SOME-SEQUENCE > . . . .. . (get-next) . > . . . (get-next) . . . etc.) > --- > > where I don't pas

[racket] flymake for Emacs

2012-05-21 Thread Eli Barzilay
There was a question on SO on flymake -- an Emacs thing that runs your file through a "syntax checker" and highlights errors. The syntax checker usually means compile the file, which in racket's case is simple: I got it working using "racket -qf " which will show syntax errors without actually run

[racket] Reading bibtex files

2012-05-21 Thread Laurent
Hi, I would like to use scriblib/bibtex which looks like a wonderful tool, but I can't seem to have it work: #lang racket (require scriblib/bibtex) (define-bibtex-cite "biblio.bib" ~cite citet generate-bibliography) fails with: ../../usr/lib/racket-5.3.0.8/collects/scriblib/bibtex.rkt:84:9

Re: [racket] DrRacket and The Little Schemer?

2012-05-21 Thread Matthias Felleisen
Olwe, this is the correct thing to do. I do have a 70% implementation of a TLS language somewhere, I am just too conservative to plug these things into the code base and let bug reports drive me. I guess I should dig it out one day. -- Matthias On May 21, 2012, at 12:29 AM, Erik Silkens

Re: [racket] syntax-parse #:at

2012-05-21 Thread Matthew Flatt
At Sun, 20 May 2012 22:42:30 -0600, Jon Rafkind wrote: > The issue is why do I have to use a name other than 'name' for the > pattern variable on the line where it says 'HERE'. If I use the > 'name' pattern variable then the syntax-parse form generated by > 'make-transformer' will use the wrong lex

Re: [racket] looking for a twitter library (or, failing that, OAuth 1.0)

2012-05-21 Thread Erik Silkensen
The arc page is out of date -- it will run with the MzScheme included in the current Racket download (https://sites.google.com/site/arclanguagewiki/getting-started/install-arc) On May 21, 2012, at 12:37 AM, Marijn wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 14-05-12 08:03,

Re: [racket] gl2d / gl-world: Debugging strange error / determining which libraries are missing

2012-05-21 Thread Stephan Houben
This looks like a bug in gl-world. gl-world fails to specify the style 'gl to the canvas% constructor. See: http://docs.racket-lang.org/gui/canvas_.html?q=canvas I guess Jay is using a platform on which it happens to work without style 'gl. Stephan 2012/5/18 JP Verkamp > Interesting. Taking

Re: [racket] Finite State Machines of Arbitrary Size using Racket's composable control

2012-05-21 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Zack, On 15-05-12 18:56, Galler wrote: > This code was generated in response to the user who sought to > implement run-length encoding of a bit-vector on Sunday night. > > I didn't post this to the board b/c there's a much easier way to > solve pr