[racket] help with error messages when installing socket from Planet?

2010-07-22 Thread George Oliver
hi, I'm a beginner with Racket and ran into this when trying to install socket from within DrRacket: # Welcome to DrRacket, version 5.0 [3m]. Language: scheme; memory limit: 256 MB. > (require (planet vyzo/socket)) Error [CALL] 121 in _constants.c: Bad place for function call, starting tok is

[racket] read of numbers with decimal point default to exact?

2010-07-22 Thread Neil Van Dyke
This is just a small idea, not something I'd argue for strongly... How about making numbers formatted with decimal points, like "12.34", read as exact rather than inexact? The rationale being: decimal point format is a commonplace and very useful format for writing exact rational numbers, and

Re: [racket] Facing some flickering problems

2010-07-22 Thread Robby Findler
Right. But that is probably not happening in your case, unless you are creating the bitmaps over and over. Robby On Thu, Jul 22, 2010 at 8:29 PM, Mathew Kurian wrote: > So in terms of garbage collection...the deletion of those arrays are the > only part. > > On Thu, Jul 22, 2010 at 9:27 PM, Robb

Re: [racket] set-panel-background ?

2010-07-22 Thread Matthew Flatt
At Thu, 22 Jul 2010 15:08:45 +0200, Laurent wrote: > On Thu, Jul 22, 2010 at 14:51, Matthew Flatt wrote: > > After GRacket moves to more modern GUI toolkits, we'll revisit > > questions like this, based on what the toolkits provide. > > > > Can't wait for this! > Do you have an idea of when you m

Re: [racket] Facing some flickering problems

2010-07-22 Thread Stephen Bloch
A month or two ago, in a discussion of 2htdp/image and universe, two of us independently came up with more or less the same answer to our different problems: provide an easy way to render a 2:image to a bitmap, and cache this bitmap for rapid display the next time. This way if your animation ha

Re: [racket] Facing some flickering problems

2010-07-22 Thread Mathew Kurian
So in terms of garbage collection...the deletion of those arrays are the only part. On Thu, Jul 22, 2010 at 9:27 PM, Robby Findler wrote: > On Thu, Jul 22, 2010 at 8:21 PM, Mathew Kurian > wrote: > > If someone has a bit of spare time, can he/she explain how these images > are > > loaded (time,

Re: [racket] Facing some flickering problems

2010-07-22 Thread Robby Findler
On Thu, Jul 22, 2010 at 8:21 PM, Mathew Kurian wrote: > If someone has a bit of spare time, can he/she explain how these images are > loaded (time, allocation, garbage collection, etc) and then reproduced again > during the redraws, it would be extremely useful. That particular aspect of the syst

Re: [racket] Facing some flickering problems

2010-07-22 Thread Mathew Kurian
I agree with that Robby, but the issue I see is once the image is loaded once, in other words the image is seen on the frame/canvas at least once, the next time it comes up on that same frame during the same run, it works with minimal load time. If someone has a bit of spare time, can he/she expla

Re: [racket] Facing some flickering problems

2010-07-22 Thread Robby Findler
If you define the images at the top-level of your program and then just refer to the variables, that is what will happen. It may or may not speed up drawing, however, depending if what is slow is the actual drawing or not. Performance debugging is not as easy as writing the program in the first pl

Re: [racket] Facing some flickering problems

2010-07-22 Thread Mathew Kurian
i am using the 5.0.1.1 racket build with 2htdp/image and 2htdp/universe and capping the memory at 512 MB. Is there anyway, I can preload the images for universe and then use them (almost like the java way). Or is there some place i can store the images in some sort of hash map. Basically, instead

Re: [racket] get-uncovered-expressions

2010-07-22 Thread Nadeem Abdul Hamid
Apparently the coverage thing only works if the evaluator is given a (byte) string (as opposed to an input port or anything else), so using port->bytes when reading from a file produces the expected result:  (define Ev   (call-with-input-file* "test.rkt"     (λ(inp)       (parameterize ([sandbox-c

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

2010-07-22 Thread YC
On Thu, Jul 22, 2010 at 6:38 AM, Matthias Felleisen wrote: > > YC, this can all work out IF you organize your program like this: > > module A: define functions, export with contracts and only with contracts > module B: import A and create the assoc lists from here > module C: the client imports

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

2010-07-22 Thread YC
On Thu, Jul 22, 2010 at 4:58 AM, Robby Findler wrote: > The way the contract system creates the wrappers is a bit subtle. In > general, it needs to create at least one wrapper object per module > that uses the procedure so it tries to create at most one as well, but > in the REPL it cannot do t

Re: [racket] Facing some flickering problems

2010-07-22 Thread Mathew Kurian
one mo thing... if you need the files to check it out...just mention it...like i said, it is not optimized yet, but you can still check it out if you want. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] Facing some flickering problems

2010-07-22 Thread Matthias Felleisen
On Jul 22, 2010, at 2:25 PM, Mathew Kurian wrote: > Yes, Matthias...mine is using universe, so i don't think i can pesonally > implement double buffering... i think it is caused from the game being to > large...but its just a thought you guys are the pros, so you teach me. > > I have a lot of

Re: [racket] Facing some flickering problems

2010-07-22 Thread Mathew Kurian
Yes, Matthias...mine is using universe, so i don't think i can pesonally implement double buffering... i think it is caused from the game being to large...but its just a thought you guys are the pros, so you teach me. I have a lot of transparency in my images...i personally make them using firewor

Re: [racket] tool: show module exports

2010-07-22 Thread Stephen De Gabrielle
This is cool, I'm calling it from drracket, but it seems to be choking on mred-kernel. S. On Wednesday, July 21, 2010, Jon Rafkind wrote: >  I wrote a simple tool (attached) that displays all the exports from a > module; their name as well as their phase. I'll probably make it show imports >

Re: [racket] tool: show module exports

2010-07-22 Thread Stevie Strickland
On Jul 22, 2010, at 12:51 PM, Robby Findler wrote: > On Thu, Jul 22, 2010 at 11:47 AM, Stevie Strickland > wrote: >> On Jul 22, 2010, at 12:41 PM, Robby Findler wrote: >>> We could make the blame information available. Would that help? >> >> I'm not sure what you mean by this. Could you elaborat

Re: [racket] tool: show module exports

2010-07-22 Thread Robby Findler
On Thu, Jul 22, 2010 at 11:47 AM, Stevie Strickland wrote: > On Jul 22, 2010, at 12:41 PM, Robby Findler wrote: >> We could make the blame information available. Would that help? > > I'm not sure what you mean by this.  Could you elaborate? An object with a contract could, in addition to saying "

Re: [racket] tool: show module exports

2010-07-22 Thread Stevie Strickland
On Jul 22, 2010, at 12:41 PM, Robby Findler wrote: > We could make the blame information available. Would that help? I'm not sure what you mean by this. Could you elaborate? Stevie _ For list-related administrative tasks: http://lists.racket-la

Re: [racket] Facing some flickering problems

2010-07-22 Thread Matthias Felleisen
Matt, if this project ran on Universe using the world canvas, it shouldn't have the double buffering. On Jul 22, 2010, at 12:30 PM, Doug Williams wrote: > I have a package on PLaneT called animated-canvas that does the double > buffering automatically. I use it for my own animations. > > On

Re: [racket] tool: show module exports

2010-07-22 Thread Robby Findler
We could make the blame information available. Would that help? Robby On Thu, Jul 22, 2010 at 11:33 AM, Stevie Strickland wrote: > Yeah, I do know that.  We only hang the contracts on things that are wrapped. >  This means that you'll also see the same behavior on contracts that involve > immu

Re: [racket] tool: show module exports

2010-07-22 Thread Stevie Strickland
Yeah, I do know that. We only hang the contracts on things that are wrapped. This means that you'll also see the same behavior on contracts that involve immutable data structures. For example, for the module: #lang racket (provide/contract [fun-list (listof (-> any/c any/c))]) (define fun-lis

Re: [racket] Facing some flickering problems

2010-07-22 Thread Doug Williams
I have a package on PLaneT called animated-canvas that does the double buffering automatically. I use it for my own animations. On Wed, Jul 21, 2010 at 9:53 PM, Noel Welsh wrote: > Are you doing double buffering? This answer is probably relevant: > > http://lists.racket-lang.org/users/archive/20

Re: [racket] tool: show module exports

2010-07-22 Thread Jon Rafkind
On 07/21/2010 02: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 it a try? And perhaps Sam and you can th

Re: [racket] Project Ideas

2010-07-22 Thread Paulo J. Matos
Ohad Kammar writes: > Nevertheless, an easy-to-find project list is desirable. Is there any > such thing? > I don't think so but I think a Racket Wiki would be a great thing. Unfortunately wiki.racket-lang.org returns 404. Maybe its time to change that? -- PMatos

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

2010-07-22 Thread Matthias Felleisen
YC, this can all work out IF you organize your program like this: module A: define functions, export with contracts and only with contracts module B: import A and create the assoc lists from here module C: the client imports from B only and performs all ops on the assoc list via B operatio

Re: [racket] set-panel-background ?

2010-07-22 Thread Laurent
On Thu, Jul 22, 2010 at 14:51, Matthew Flatt wrote: > At Thu, 22 Jul 2010 10:26:47 +0200, Laurent wrote: > > I can see there is a `get-panel-background' function that returns the > > background color of panels, but is there a `set-panel-background' or > > something equivalent? > > No, there's no

Re: [racket] set-panel-background ?

2010-07-22 Thread Matthew Flatt
At Thu, 22 Jul 2010 10:26:47 +0200, Laurent wrote: > I can see there is a `get-panel-background' function that returns the > background color of panels, but is there a `set-panel-background' or > something equivalent? No, there's no way currently to set the background of a panel. Even `get-panel-

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

2010-07-22 Thread Robby Findler
On Thu, Jul 22, 2010 at 3:27 AM, John Sampson wrote: > I haven't really found my way round the documentation yet. I find that if I > want to look up "directory-exists?" > using Google in Mozilla Firefox is the best way. That is probably not the best thing to do. Instead, let me recommend that yo

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

2010-07-22 Thread Robby Findler
Yes, that's not quite precise enough about eq?. It really just means "at the low level are these two objects stored in the same place in memory". Nothing more, nothing less. In general, for procedures it does not come with any guarantees and lots of things in the system can change how it works. (Th

Re: [racket] tool: show module exports

2010-07-22 Thread Robby Findler
On Wed, Jul 21, 2010 at 8: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). > > `obj

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

2010-07-22 Thread John Sampson
Oddly the search box didn't give me the answer yesterday (via Internet Explorer), but today it seems to work after a delay. As for examples, I think the more examples the better - one cannot have too many, if space allows. An example can be worth a thousand words of explanation. I expect I am n

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

2010-07-22 Thread Noel Welsh
Entering 'directory-exists?' in the search box at http://docs.racket-lang.org/ (equivalently, use the Help Desk) gives me one answer. Is the issue that the search is not good enough (it could be better but it is pretty good) or that the docs don't have enough context and examples? N. On Thu, Jul

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

2010-07-22 Thread John Sampson
Hello Many thanks. Perhaps where "directory-exists?" is explained in the documentation, there should also be a pointer to an explanation what to substitute for the place-holder "path" (in italic). This would mention the need to escape the backslash, which to a newbie like myself is not obvious

[racket] set-panel-background ?

2010-07-22 Thread Laurent
Hi, I can see there is a `get-panel-background' function that returns the background color of panels, but is there a `set-panel-background' or something equivalent? Thanks, Laurent _ For list-related administrative tasks: http://lists.racket-lan