Re: [racket] procedure, contract, assoc, and REPL

2010-07-21 Thread YC
Hi Robby - What I am trying to do is to look up a key/value pair where the key happens to be the procedure. The struct idea will work only if I can serialize/hash the procedure into a unique key, which means I will still have to rely on a procedure matching itself (otherwise it's too much work fo

Re: [racket] Facing some flickering problems

2010-07-21 Thread Mathew Kurian
yes sir :) _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] Facing some flickering problems

2010-07-21 Thread Mathew Kurian
thank you Noel...got it srry for not searching well enough to find thatthis thread can now be closed _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] Facing some flickering problems

2010-07-21 Thread Noel Welsh
Are you doing double buffering? This answer is probably relevant: http://lists.racket-lang.org/users/archive/2009-April/032035.html HTH, N. On Thu, Jul 22, 2010 at 4:46 AM, Mathew Kurian wrote: > Hey guys, > Recently, I had started coding a game in racket and its grown a bit > recently. Its sti

[racket] Facing some flickering problems

2010-07-21 Thread Mathew Kurian
Hey guys, Recently, I had started coding a game in racket and its grown a bit recently. Its still just 2D/ semi 3D, but I am facing some serious flickering when running on a linux machine. However, on a Windows it works fine. Its about 310 MB, so its a bit hard on the memory. (not completely optim

Re: [racket] tool: show module exports

2010-07-21 Thread Jon Rafkind
On 07/21/2010 07:41 PM, Stevie Strickland wrote: On Jul 21, 2010, at 9:33 PM, Jon Rafkind wrote: On 07/21/2010 05:26 AM, Robby Findler wrote: One, non-optimal way to get the contracts is to evaluate the module and use object-contract on the exports (non-optimal because dependent contracts will

Re: [racket] Simplifying keyword arguments

2010-07-21 Thread Greg Hendershott
I've had the same thought. Plus with contracts, can even be 3 times in proximity, e.g. (define/contract (my-pony #:color [color "red"]) (() (#:color string?) . ->* . any) which is a bit like the Department of Redundancy Department's Division of Redundancy Division. :) Not a very big annoyanc

Re: [racket] tool: show module exports

2010-07-21 Thread Matthias Felleisen
That's damn cute! On Jul 21, 2010, at 9:41 PM, Stevie Strickland wrote: > On Jul 21, 2010, at 9:33 PM, Jon Rafkind wrote: >> On 07/21/2010 05:26 AM, Robby Findler wrote: >>> One, non-optimal way to get the contracts is to evaluate the module >>> and use object-contract on the exports (non-opt

Re: [racket] tool: show module exports

2010-07-21 Thread Stevie Strickland
On Jul 21, 2010, at 9:33 PM, Jon Rafkind wrote: > On 07/21/2010 05:26 AM, Robby Findler wrote: >> One, non-optimal way to get the contracts is to evaluate the module >> and use object-contract on the exports (non-optimal because dependent >> contracts will have ...s in them, etc). > `object-contrac

Re: [racket] tool: show module exports

2010-07-21 Thread Jon Rafkind
On 07/21/2010 05:26 AM, Robby Findler wrote: One, non-optimal way to get the contracts is to evaluate the module and use object-contract on the exports (non-optimal because dependent contracts will have ...s in them, etc). `object-contract' looks like its only for stuff from the class system, r

Re: [racket] procedure, contract, assoc, and REPL

2010-07-21 Thread Robby Findler
You seem to be relying on identity of procedures (which is a bad idea). Contracts on functions are implemented with wrappers which breaks that by making fewer things equal but compiler optimizations can take things the other direction making more things equal than you might expect. Overall I think

Re: [racket] get-uncovered-expressions

2010-07-21 Thread Nadeem Abdul Hamid
> I can't produce a more thorough answer now, but in general the whole > uncovered expressions feature relies on expressions with a source > indication. For example, this works as you expect: > ... > and it should also work for a sandbox that is created from a file. OK, thanks, that sort of make

Re: [racket] get-uncovered-expressions

2010-07-21 Thread Eli Barzilay
On Jul 21, Nadeem Abdul Hamid wrote: > Sorry if I am missing something obvious, by why does the following > produce '() ? > > (define Ev > (parameterize ([sandbox-coverage-enabled #t]) > (make-evaluator 'lang/htdp-intermediate > `(define (f x) >(if

[racket] procedure, contract, assoc, and REPL

2010-07-21 Thread YC
Hi all - I am running into an interesting issue where an alist of procedures in REPL, the ones without a contract works with assoc, but the ones with contract do not work with assoc. What I have is an alist where the keys are procedures. Some of these procedures have contracts attached to them,

[racket] get-uncovered-expressions

2010-07-21 Thread Nadeem Abdul Hamid
Sorry if I am missing something obvious, by why does the following produce '() ? (define Ev (parameterize ([sandbox-coverage-enabled #t]) (make-evaluator 'lang/htdp-intermediate `(define (f x) (if (zero? x) "zero" "non-zero")) `(

Re: [racket] Newbie question - Drscheme hangs on directory-exists?

2010-07-21 Thread Eli Barzilay
On Jul 21, Ryan Culpepper wrote: > You need to escape the backslash in your string: > >(directory-exists? "C:\\iconsource") > > DrRacket colors the bad string red to indicate that there's a > problem with it. If you insert the extra backslash, it turns green. > > Wouldn't it be nice for DrRa

Re: [racket] Bulding for Solaris 5.10 AMD64

2010-07-21 Thread Matthew Flatt
At Wed, 21 Jul 2010 12:58:48 +0100, Tim Brown wrote: > On 21/07/10 02:20, Matthew Flatt wrote: > > I've pushed a repair to the git repo, along with your patch to > > "sconfig.h". > > > > The bug was in the code that patches a return address in the stack to > > release cached stack-trace information

Re: [racket] Newbie question - Drscheme hangs on directory-exists?

2010-07-21 Thread Ryan Culpepper
John Sampson wrote: Hello - If I enter "(directory-exists? "C:\iconsource")" into DrRacket I would expect it to answer with "#t" or "'#f" but in fact the cursor goes to the next line, leaving an indent. I am running this on Windows 7. As a newbie I do not understand this behaviour. You need t

Re: [racket] Newbie question - Drscheme hangs on directory-exists?

2010-07-21 Thread Matthias Felleisen
On Jul 21, 2010, at 5:22 PM, John Sampson wrote: > Hello - > > If I enter "(directory-exists? "C:\iconsource")" into DrRacket > I would expect it to answer with "#t" or "'#f" but in fact the > cursor goes to the next line, leaving an indent. > I am running this on Windows 7. Do you mean you

[racket] Newbie question - Drscheme hangs on directory-exists?

2010-07-21 Thread John Sampson
Hello - If I enter "(directory-exists? "C:\iconsource")" into DrRacket I would expect it to answer with "#t" or "'#f" but in fact the cursor goes to the next line, leaving an indent. I am running this on Windows 7. As a newbie I do not understand this behaviour. Is there a tutorial on file i/o

Re: [racket] CoreMIDI bindings

2010-07-21 Thread Ryan Culpepper
On 07/21/2010 02:43 PM, Evan Hanson wrote: > Makes sense. That's nice flexibility for module users. > > Out of curiosity, how dynamic are module names? Can they be > manipulated? Say you had two modules that each provide a function > "connect". You would load them as mod1:connect and mod2:connect

Re: [racket] CoreMIDI bindings

2010-07-21 Thread Matthias Felleisen
Parameterized modules are called 'units' and it's a different ball game. Yes, something like this is doable. In this world, you can write (define (f some-unit-module) ... (connect a b c) ... ) and connect comes from the 'unit module' you pass in. -- Matthias On Jul 21, 2010, at 4:4

Re: [racket] tool: show module exports

2010-07-21 Thread Matthias Felleisen
Yeap, that's the goal. On Jul 21, 2010, at 4:47 PM, Jon Rafkind wrote: > Yea sure. I was just getting the import stuff to show. If hacking contracts > is too hard maybe I can get some advice at PLT/Racket day. > > On 07/21/2010 12:46 PM, Matthias Felleisen wrote: >> Jon, do you want to give

Re: [racket] tool: show module exports

2010-07-21 Thread Jon Rafkind
Yea sure. I was just getting the import stuff to show. If hacking contracts is too hard maybe I can get some advice at PLT/Racket day. On 07/21/2010 12:46 PM, Matthias Felleisen wrote: Jon, do you want to give it a try? And perhaps Sam and you can then figure out how to get the types out. O

Re: [racket] CoreMIDI bindings

2010-07-21 Thread Ryan Culpepper
On 07/21/2010 12:51 PM, Evan Hanson wrote: > In an effort to learn scheme, I ported some bindings for a subset of > the OS X CoreMIDI API from a Ruby project of mine to scheme/foreign. > I'm posting them (a) in case anyone wants to use them, but more > because (b) I'm hoping for some feedback. I'm

Re: [racket] CoreMIDI bindings

2010-07-21 Thread Evan Hanson
Makes sense. That's nice flexibility for module users. Out of curiosity, how dynamic are module names? Can they be manipulated? Say you had two modules that each provide a function "connect". You would load them as mod1:connect and mod2:connect using prefix-in -- how might one design a form that w

Re: [racket] CoreMIDI bindings

2010-07-21 Thread Evan Hanson
Yeah, I will if I flesh this out and put it on planet. That was more just to make sure it works (didn't even mean to include it). Thanks for the tip, though, rackunit looks helpful and relatively familiar in design. re: let/for forms -- I guess I'm just not sure what's the favored form for a given

Re: [racket] CoreMIDI bindings

2010-07-21 Thread Todd O'Bryan
> On Jul 21, 2010, at 2:51 PM, Evan Hanson wrote: > > Also, is this the kind of thing that should be namespaced? In > contrast to other languages where namespacing is used heavily > (sometimes even to a fault), it seems that many scheme libraries > are quite flat. Is this simply left up to the user

Re: [racket] CoreMIDI bindings

2010-07-21 Thread Matthias Felleisen
On Jul 21, 2010, at 2:51 PM, Evan Hanson wrote: > Also, is this the kind of thing that should be namespaced? In contrast to > other languages where namespacing is used heavily (sometimes even to a > fault), it seems that many scheme libraries are quite flat. Is this simply > left up to the use

Re: [racket] CoreMIDI bindings

2010-07-21 Thread Laurent
On Wed, Jul 21, 2010 at 20:51, Evan Hanson wrote: > In an effort to learn scheme, I ported some bindings for a subset of the OS > X CoreMIDI API from a Ruby project of mine to scheme/foreign. I'm posting > them (a) in case anyone wants to use them, Nice! You really should put this on PLaneT, th

[racket] CoreMIDI bindings

2010-07-21 Thread Evan Hanson
In an effort to learn scheme, I ported some bindings for a subset of the OS X CoreMIDI API from a Ruby project of mine to scheme/foreign. I'm posting them (a) in case anyone wants to use them, but more because (b) I'm hoping for some feedback. I'm sure there are places where I could have done th

Re: [racket] tool: show module exports

2010-07-21 Thread Matthias Felleisen
Jon, do you want to give it a try? And perhaps Sam and you can then figure out how to get the types out. On Jul 21, 2010, at 7:26 AM, Robby Findler wrote: > One, non-optimal way to get the contracts is to evaluate the module > and use object-contract on the exports (non-optimal because depend

[racket] Simplifying keyword arguments

2010-07-21 Thread Laurent
Hi, When using keyword arguments, I often write: (define (foo #:some-arg some-arg) ) or: (define (foo #:some-arg [some-arg a-value]) ) This redundancy between the keyword name and the argument name bothers me a little each time I use it. Would it be wrong to simplify this to: (define (

Re: [racket] Bulding for Solaris 5.10 AMD64

2010-07-21 Thread Tim Brown
One note, however. When I "make install", raco does not add -m64 to either CFLAGS or LDFLAGS. (And since I was root to install, gcc wasn't visible, either). Through a bit of trail and error, I figured out to put them in the environment as in: LDFLAGS=-m64 PATH=/usr/sfw/bin/:$PATH CFLAGS=-m64 gma

Re: [racket] Bulding for Solaris 5.10 AMD64

2010-07-21 Thread Tim Brown
Matt, I have successfully built racket for Solaris 5.10 AMD64 from git. Thank you very much for your help. On 21/07/10 02:20, Matthew Flatt wrote: I've pushed a repair to the git repo, along with your patch to "sconfig.h". The bug was in the code that patches a return address in the stack to

Re: [racket] tool: show module exports

2010-07-21 Thread Robby Findler
One, non-optimal way to get the contracts is to evaluate the module and use object-contract on the exports (non-optimal because dependent contracts will have ...s in them, etc). Robby On Wed, Jul 21, 2010 at 4:26 AM, Matthias Felleisen wrote: > > Thou shall ask and receive. Thanks! > > Can I get

Re: [racket] All black images...Ahhh

2010-07-21 Thread Stephen Bloch
On Jul 20, 2010, at 11:26 PM, Matthew Flatt wrote: > Generating the variant can allocate, and therefore might trigger the > little recycle icon in DrRacket during a garbage collection. > Unfortunately, drawing the recycle icon would steal a resource that was > being used to generate the variant b

Re: [racket] tool: show module exports

2010-07-21 Thread Matthias Felleisen
Thou shall ask and receive. Thanks! Can I get the contracts if it comes via provide/contract and/or the types if it comes from Typed Racket (this might be the difficult one, because types are gone after expansion). And I think we should somehow combine provide-document with provide/contract

Re: [racket] All black images...Ahhh

2010-07-21 Thread Mark Engelberg
I recently reported a bug that sounds extremely related: (Problem Report 11033) where empty white scenes were sometimes showing up as black. Also on Windows. You might want to check whether this fix addresses that bug as well, and if so, you can close out that problem report.