Re: [racket] Another macro question: making a lexically binding keyword?

2012-05-01 Thread Eli Barzilay
Three hours ago, Danny Yoo wrote: > > > > there is no breakage here: the way that your `interfere' is broken > > is essentially the feature that syntax parameters provide: making > > it possible to have new forms that will adjust the meaning of > > `INDEX'. If you don't want that, then you can use

Re: [racket] Another macro question: making a lexically binding keyword?

2012-05-01 Thread Danny Yoo
>> I need to do something extra, since the use of interfere adds an >> additional syntax parameterization that breaks the lexicalness I >> expected from INDEX. > > there is no breakage here: the way that your `interfere' is broken is > essentially the feature that syntax parameters provide: making

Re: [racket] REPL "Organism" <=> The Borg?

2012-05-01 Thread Matthias Felleisen
On May 1, 2012, at 4:04 PM, Olwe Melwasul wrote: > But then I've heard people from PLT/Racket downplaying the whole dynamic > feeding of a REPL. The repl is an invaluable tool for exploring ideas. Think of it as a sketchpad. I would not want to live without it. When it comes to building and

Re: [racket] Racket website "Generate HTML or PDF" example.

2012-05-01 Thread Neil Van Dyke
Harry Spier wrote at 05/01/2012 09:06 PM: When I load this into DrRacket a button comes up in DrRacket "Scribble HTML" which when pressed causes an HTML page to be displayed in my browser but how do I use this code to create a PDF page. This might help: http://doc.racket-lang.org/scribble/r

[racket] Racket website "Generate HTML or PDF" example.

2012-05-01 Thread Harry Spier
On the Racket website "Start Quickly" section there is an example to generate an HTML or PDF page through Scribble. #lang scribble/base @; Generate a PDF or HTML document @title{Bottles --- @italic{Abridged}} @(apply itemlist (for/list ([n (in-range 100 0 -1)]) @item{@(format "~a" n) bottles

Re: [racket] redex: default matching behavior of patterns

2012-05-01 Thread Robby Findler
Sorry-- this was already unchangable 5 years ago, nevermind today. Robby On Tue, May 1, 2012 at 6:56 PM, Jon Rafkind wrote: > Just in case it was unclear I was hoping people would explicitly adorn > pattern variables if they want to match the same term. > > (simple integer_1 integer_1) > > But

Re: [racket] redex: default matching behavior of patterns

2012-05-01 Thread Jon Rafkind
Just in case it was unclear I was hoping people would explicitly adorn pattern variables if they want to match the same term. (simple integer_1 integer_1) But if (simple integer integer) to match the same term twice is a heavily used form then so be it.. On 05/01/2012 05:52 PM, Robby Findler w

Re: [racket] redex: default matching behavior of patterns

2012-05-01 Thread Robby Findler
This is heavily relied on. Robby On Tue, May 1, 2012 at 6:45 PM, Jon Rafkind wrote: > The default matching behavior of patterns in redex will try to match > duplicate pattern variables to the same term. Thus > > #lang racket > > (require redex) > > (define-language Z [x integer]) > (define-meta

Re: [racket] redex: default matching behavior of patterns

2012-05-01 Thread Jon Rafkind
Ok after 2 minutes more of thought I guess the response will most likely be "which integer will you be referencing in the result of the metafunction" -- so maybe it can be an error to use an unadorned pattern variable twice in a pattern? On 05/01/2012 05:45 PM, Jon Rafkind wrote: > The default

[racket] redex: default matching behavior of patterns

2012-05-01 Thread Jon Rafkind
The default matching behavior of patterns in redex will try to match duplicate pattern variables to the same term. Thus #lang racket (require redex) (define-language Z [x integer]) (define-metafunction Z simple : integer integer -> integer [(simple integer integer) 1]) (term (simple 1 2))

Re: [racket] REPL "Organism" <=> The Borg?

2012-05-01 Thread Eli Barzilay
30 minutes ago, Olwe Melwasul wrote: > > Is anyone thinking along these lines? It seems like an environment > like Lisp/ Scheme with so much blurring of data and code, with > homoiconicity (why live without it?), with a REPL able to take new > code on the fly would be getting there. [...] Sounds

Re: [racket] Unit Testing Best Practice in Racket

2012-05-01 Thread Matthias Felleisen
Do try the DrRacket head in git. See #3 below. You can have your cake and eat it. Personally: Use rackunit to (define/provide-test-suite --test1 ... uses internal functions ...) in "main.rkt" Import into a file Tests/main.rkt, run with run-test-suite Always have both file

Re: [racket] Distributing an app with required fonts

2012-05-01 Thread Matthew Flatt
At Tue, 1 May 2012 13:57:54 -0600, Kieron Hardy wrote: > WRT fonts: AFAIK the only way for Windows to see a font is to copy the font > file to the special Windows font dir, But that probably does not account for > programs like Word that can somehow bundle the font used along with the > document

[racket] REPL "Organism" <=> The Borg?

2012-05-01 Thread Olwe Melwasul
I'm still just a beginner, but what intrigues me about Lisp/Scheme is the idea of the REPL and being able to add stuff dynamically. (Blame "Lisp at JPL"? Beginners should not be allowed to read that essay.) Coupled with the idea that functional programming should be about *evaluating expressions* r

Re: [racket] Distributing an app with required fonts

2012-05-01 Thread Kieron Hardy
Thanks for the info Robby and Matthias. Since my needs right now are simple, I'll look at the API and maybe I can cobble together enough of an installation script of sorts using Racket, rather than go the usual route of building an installer using VS or whatever. BTW, this SO thread (http://st

Re: [racket] Unit Testing Best Practice in Racket

2012-05-01 Thread Chad Albers
Thanks for the great suggestions. I agree that I should really be testing the public interface rather than the implementation. As a Racket n00b, I write small functions to compose the larger public facing functions, so testing these smaller/private functions prevents me for going off track. Than

Re: [racket] Formatted output of floating-point numbers?

2012-05-01 Thread William James
On Thu, Jan 12, 2012 at 4:53 AM, Dmitry Pavlov wrote: > I have been looking for a way to do in Racket > something you can easily do in C: > > printf("%10.5lf\n", 12.345678); > > so it properly cuts the fractional part to 5 digits > and adds padding to get 10 characters in total, > producing "

Re: [racket] typed racked questions

2012-05-01 Thread Jay McCarthy
It will not be in the release. It is an undergrad's summer project. It's in the early stages now, so nothing more to say really. A big problem will that Typed Racket is very primitive w.r.t to Racket features like keyword arguments and structure properties that are used in the server. Jay On Mon,

Re: [racket] John Carmack on why functional programming matters

2012-05-01 Thread Matthias Felleisen
But his only reference to Utah is http://www.cs.utah.edu/~hal/docs/daume02yaht.pdf so he hasn't really seen the light yet. On May 1, 2012, at 11:55 AM, Neil Toronto wrote: > And how to do it in C++: > > gamasutra.com/view/news/169296/Indepth_Functional_programming_in_C.php > > He's not

Re: [racket] typed racked questions

2012-05-01 Thread Vincent St-Amour
At Mon, 30 Apr 2012 23:12:35 +0100, Bikal Gurung wrote: > What are DrRacket and other racket libs written in ? typed/untyped racket ? DrRacket is written in untyped Racket, with a bit of Typed Racket. Most libraries are untyped, but some are typed (quickly skimming the PLaneT listing: purely func

Re: [racket] typed racked questions

2012-05-01 Thread Vincent St-Amour
At Mon, 30 Apr 2012 23:07:38 +0100, Bikal Gurung wrote: > hmmm ... I am getting some error. My repl session below. I am using 'db' > module. > > > bind-prepared-statement > . Type Checker: untyped top-level identifier lifted.474 in: > bind-prepared-statement > > > > Not sure what to make of it. M

Re: [racket] typed racked questions

2012-05-01 Thread Sam Tobin-Hochstadt
On Tue, May 1, 2012 at 11:58 AM, Hendrik Boom wrote: > On Mon, Apr 30, 2012 at 08:48:38AM -0400, Sam Tobin-Hochstadt wrote: >> >> > 5) Is there a Hindlye/Milner style type inferencing algorithm for typed >> > racket being worked on? >> >> The Typed Racket type system contains a number of features

Re: [racket] typed racked questions

2012-05-01 Thread Hendrik Boom
On Mon, Apr 30, 2012 at 08:48:38AM -0400, Sam Tobin-Hochstadt wrote: > > > 5) Is there a Hindlye/Milner style type inferencing algorithm for typed > > racket being worked on? > > The Typed Racket type system contains a number of features that go > beyond what's supported in Hindley/Milner style t

[racket] John Carmack on why functional programming matters

2012-05-01 Thread Neil Toronto
And how to do it in C++: gamasutra.com/view/news/169296/Indepth_Functional_programming_in_C.php He's not saying anything PLT hasn't been saying for years. But he does say some of them differently. And he's John FRIGGIN' Carmack: the guy behind the first 3D games ever made, and a current game

Re: [racket] scribble defproc formatting question

2012-05-01 Thread Neil Van Dyke
Laurent wrote at 05/01/2012 07:30 AM: FWIW, the docs for defform say: "The typesetting of form-datum, subform-datum, and contract-expr-datum preserves the source layout, like racketblock

Re: [racket] scribble defproc formatting question

2012-05-01 Thread Laurent
On Tue, May 1, 2012 at 13:17, Neil Van Dyke wrote: > I might be mistaken, but it looks like Scribble depends very much on > source location info for formatting this -- it looks like even a form read > as "(a b)" will format as "(ab)" in some cases if the source location info > is stripped. > > If

Re: [racket] scribble defproc formatting question

2012-05-01 Thread Neil Van Dyke
I might be mistaken, but it looks like Scribble depends very much on source location info for formatting this -- it looks like even a form read as "(a b)" will format as "(ab)" in some cases if the source location info is stripped. If this is true, is my best bet to feed the generated syntax t