Re: [racket] Racket style guide (was Re: Argument order conventions (was: Variable naming conventions))

2011-09-19 Thread Tom McNulty
Thanks for the guide! What is the Racket convention for named constants? Somewhere along the way I picked up the convention of prefixing constants with k, ie. kMyConstant. Transmuted into racket I find myself typing: (define k-my-constant ...) is there an established convention? - Tom __

Re: [racket] Offtopic: Learning SML

2011-09-19 Thread Neil Van Dyke
Thanks for the excellent travel guide, Ray. I'd also encourage people to spend a summer backpacking in Europe, and to see someplace new once a year, but not to *always* be a tourist. If one is looking for a place to call home and to explore in-depth for a good while, and hopefully contribute,

Re: [racket] Offtopic: Learning SML

2011-09-19 Thread Ray Racine
Some of these opinions are rather stale. That said. SML is very much a dual of Scheme with types and inference. Very much a dual in the sense SML's core syntax is minimal, clean and elegant. From a type perspective H-M inference isn't as amazing as it used to be. Haskell, Scala, yes and Type

Re: [racket] plai test/exn

2011-09-19 Thread Eric Dobson
I found it immediately by searching for error on docs.racket-lang.org, and going to the plai entry. http://docs.racket-lang.org/plai/plai-scheme.html?q=error#(def._((lib._plai/main..rkt)._error)) Is there some other place you would expect it to be? (It does need some scheme->racket cleanup thoug

Re: [racket] plai test/exn

2011-09-19 Thread Jeremy Kun
Ah! Why don't they state that they shadow "error" in the documentation? Isn't that considered bad form? And worse, undocumented bad form! Everything I was taught in school by idealistic Racket programmers is crashing down before my eyes! I might as well be coding in C. But seriously, this should

Re: [racket] plai test/exn

2011-09-19 Thread Jay McCarthy
And that's what it means by "user code" Jay On Tue, Sep 20, 2011 at 6:57 AM, Eric Dobson wrote: > Also IIRC test/exn only works on errors raised using 'error' from > PLAI, which is different from 'error' from racket/base. > > -Eric > > On Mon, Sep 19, 2011 at 2:49 PM, John Clements > wrote: >>

Re: [racket] plai test/exn

2011-09-19 Thread John Clements
On Sep 19, 2011, at 2:57 PM, Eric Dobson wrote: > Also IIRC test/exn only works on errors raised using 'error' from > PLAI, which is different from 'error' from racket/base. Ooh, just saw that this was test/exn, not check/exn. I retract my hasty comment! John > > -Eric > > On Mon, Sep 19,

Re: [racket] plai test/exn

2011-09-19 Thread Eric Dobson
Also IIRC test/exn only works on errors raised using 'error' from PLAI, which is different from 'error' from racket/base. -Eric On Mon, Sep 19, 2011 at 2:49 PM, John Clements wrote: > > On Sep 19, 2011, at 1:47 PM, Jeremy Kun wrote: > >> Not sure if this is a bug, but it doesn't match the docume

Re: [racket] plai test/exn

2011-09-19 Thread John Clements
On Sep 19, 2011, at 1:47 PM, Jeremy Kun wrote: > Not sure if this is a bug, but it doesn't match the documentation here. It > says test/exn only succeeds when the error is explicitly raised by the user, > but I try something as simple as: > > "file1.rkt" > (provide foo) > (define (foo) (error

Re: [racket] scribble problem?

2011-09-19 Thread Matthew Flatt
Thanks! I see that message when I try in v5.1.3, but not in the latest version. We have fixed a number of taint issues since v5.1.3, so whatever went wrong for this program in v5.1.3, I believe it has been fixed. A possible workaround for v5.1.3 is to run `scribble' from the command line. That wor

[racket] plai test/exn

2011-09-19 Thread Jeremy Kun
Not sure if this is a bug, but it doesn't match the documentation here. It says test/exn only succeeds when the error is expli

Re: [racket] Controlling module bindings with filtered-out?

2011-09-19 Thread Eli Barzilay
I originally had something like that in mind, but then I figured that going with a plain `lambda' gives you all of these tweaks that you'd possibly want to do, and while they're a bit more verbose, they have the advantage of being readable without reading up on yet another provide variant. BTW,

[racket] Controlling module bindings with filtered-out?

2011-09-19 Thread Danny Yoo
Sometimes I want to write a module language that extends the functionality of another, but I want to write that extension in racket/base, not in the extending language. At the moment, I do this like this: ;;;

Re: [racket] Off topic: A curriculum (books, papers, essays) for how to design and implement compilers and interpreters?

2011-09-19 Thread Jim Wise
Shriram Krishnamurthi writes: > It depends on what kinds of compilers/interpreters they were trying to > build. A course of study for Fortran would like quite different from > one for ML would look quite different from one for JavaScript (though > there are of course many overlaps). Indeed -- I

Re: [racket] Datalog: summing

2011-09-19 Thread Wojciech Kaczmarek
Some errata below.. On Mon, Sep 19, 2011 at 14:55, Wojciech Kaczmarek wrote: > Just for the record: > > If you'd need to stay in the "Prolog" world with your summing, for example > in order to use summing result in another predicate, here's the Racklog > version: > I see I stated the above in a

Re: [racket] Datalog: summing

2011-09-19 Thread Wojciech Kaczmarek
Just for the record: If you'd need to stay in the "Prolog" world with your summing, for example in order to use summing result in another predicate, here's the Racklog version: (define %sum (%rel (x y xs acc) [('[] acc) (%= 0 acc)] [((cons x xs) acc) (%sum xs y) (%is acc (+ x y))])) Y

Re: [racket] Datalog: summing

2011-09-19 Thread Wojciech Kaczmarek
In typical Prolog the simplest way would be to use aggregate: http://www.swi-prolog.org/pldoc/doc_for?object=section(2,'A.1',swi('/doc/Manual/aggregate.html')) In Racklog you can simply use bag-of

[racket] Seamless Prolog integration

2011-09-19 Thread Jukka Tuominen
Hi, inspired by the Datalog discussion, I'd like to understand better what kind of challenges I could expect when trying to create a proof-of-concept about integrating prolog-type-of functionality to Liitin. This would also serve as an example/ stepping stone for others to create something more u

[racket] Datalog: summing

2011-09-19 Thread Mark Carter
How do I create summing rules? Suppose I have the following facts: post(cash, 26) . post(cash, -16) . post(cash, 50) . post(beer, 20) . How do I create a rule "bal" bal(X, ???) such that the ??? gives me the sum of the second arguments in post satisfying the first argument X? Also, is there a