[racket] how can I convert a list or vector to ctype array directly?

2012-12-14 Thread 刘海宽
Instead through iteration like for or do which assign values to element of array, deliver list or vector directly to the ctype function imported by ffi. Because I think that operating the list or vector with built-in functions is more conveniently than the ctype array. In the reference, I find _a

Re: [racket] Why begin0 doesn't expands to begin ?

2012-12-14 Thread Eric Dobson
begin0 is for exactly the case you ignore, multiple values. You cannot know the number of values the first expression will return statically so if you did a translation to begin it would need to allocate them in a list on the heap and then use (apply values ...) later. With begin0 as a primitive y

Re: [racket] introspecting names and versions of all planet packages used by a program

2012-12-14 Thread Neil Van Dyke
Greg Hendershott wrote at 12/14/2012 11:56 AM: The reason I want this is for the About box of an app: "http://i.imgur.com/TofUX.png";. What does it look like after you tap to expand "Hardware"? Off-topic for this thread, but: http://postimage.org/image/hnmg5klex/ (Now you know the m

Re: [racket] Places, Channels as Events. Labeling Places.

2012-12-14 Thread David T. Pierson
Tobias and Matthew, Thank you, both your answers were informative. David Racket Users list: http://lists.racket-lang.org/users

Re: [racket] introspecting names and versions of all planet packages used by a program

2012-12-14 Thread Neil Van Dyke
Matthew Flatt wrote at 12/14/2012 08:53 AM: At Thu, 13 Dec 2012 23:52:03 -0500, Neil Van Dyke wrote: Can a program running in Racket VM introspect on itself to determine the names and versions of PLaneT packages that the program uses? You should be able traverse the import hierarchy

[racket] Why begin0 doesn't expands to begin ?

2012-12-14 Thread Gustavo Massaccesi
The "begin" and "begin0" forms appear in the racket programs, in the fully expanded programs and in the bytecode. I expected that in some intermediate expansion step the "begin0" form expands to a "begin" form. For example something like: (This version doesn't work for multiple return values.) (d

Re: [racket] distributed places - throwing dcgm-type contract violation on *channel-get

2012-12-14 Thread Matthew Eric Bassett
Just to update, also tried this on v5.3.1 using spawn-node-supervise-place-at with #:thunk set. same result. On 12/14/2012 03:31 PM, Matthew Eric Bassett wrote: Hey folks, I was playing around with distributed places and I ran into a some problems. I'm using racket v5.3 and am following the

Re: [racket] SIGCHLD handler called in stderr

2012-12-14 Thread Sergey Khorev
I think this isn't exactly the problem you're looking for. You get > "waitpid: No child pocesses" because Racket (with places enabled) > creates its own thread to reap child processes. > Is it possible to make Racket not to reap child processes? Can it be done during its initialization or is comp

Re: [racket] introspecting names and versions of all planet packages used by a program

2012-12-14 Thread Greg Hendershott
> The reason I want this is for the About box of an app: > "http://i.imgur.com/TofUX.png";. What does it look like after you tap to expand "Hardware"? Racket Users list: http://lists.racket-lang.org/users

[racket] Registry renaming keys

2012-12-14 Thread Clement Erik Ferguson
I'm also interested in this, along with deleting keys. It'd be so nice to do this kind of stuff in Racket! On Fri, Dec 14, 2012 at 10:32 AM, wrote: > Date: Fri, 14 Dec 2012 09:37:39 +0100 > From: herak...@gmx.de > To: "racket " > Subject: [racket] Registry renaming keys > Message-ID: <201212140

[racket] distributed places - throwing dcgm-type contract violation on *channel-get

2012-12-14 Thread Matthew Eric Bassett
Hey folks, I was playing around with distributed places and I ran into a some problems. I'm using racket v5.3 and am following the docs from the racket reference (http://docs.racket-lang.org/reference/distributed-places.html) Let's say we have an example just like the one in the reference.

Re: [racket] introspecting names and versions of all planet packages used by a program

2012-12-14 Thread Matthew Flatt
At Thu, 13 Dec 2012 23:52:03 -0500, Neil Van Dyke wrote: > Can a program running in Racket VM introspect on itself to determine the > names and versions of PLaneT packages that the program uses? > > I tried poking around with environment introspection, and trying to > follow module use graph tha

Re: [racket] Passing info from reader level

2012-12-14 Thread Matthew Flatt
I hope it's ok that I'm cc'ing the list. You ask good questions and others might be interested in the answers or in improving my answers. At Thu, 13 Dec 2012 22:09:18 -0800, Rajah Mahsohn Omega wrote: > You gave this example for > specifying a language in a submodule. > > #lang racket/base > >

Re: [racket] Places, Channels as Events. Labeling Places.

2012-12-14 Thread Matthew Flatt
At Fri, 14 Dec 2012 09:15:48 +0100, Tobias Hammer wrote: > On Fri, 14 Dec 2012 07:25:36 +0100, David T. Pierson > wrote: > > > I've wondered about this. What is the rational behind these > > differences? Wrapping events is cumbersome. > > > > For instance, my first intuition is that the synch

[racket] Registry renaming keys

2012-12-14 Thread heraklea
Hello friends, are there functions in racket which makes regitry/keys renaming possible? I know about get-resource and write-resource. But I seems that they can only write and get. But modifying?? Yours, Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Places, Channels as Events. Labeling Places.

2012-12-14 Thread Tobias Hammer
On Fri, 14 Dec 2012 07:25:36 +0100, David T. Pierson wrote: I've wondered about this. What is the rational behind these differences? Wrapping events is cumbersome. For instance, my first intuition is that the synchronization result of a place channel would be the place channel itself, just

Re: [racket] How to get current directory in the module file?

2012-12-14 Thread Jon Rafkind
In a.rkt: #lang racket (require racket/runtime-path) (define-runtime-path cwd ".") (provide cwd) On 12/14/2012 12:55 AM, Haiwei Zhou wrote: > Hi, > > For example, I have two module a and other-directory/b > > a.rkt > - begin of file --- > > #lang racket > > (define cwd (current-directory)) >