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

2012-12-13 Thread Haiwei Zhou
Hi, For example, I have two module a and other-directory/b a.rkt - begin of file --- #lang racket (define cwd (current-directory)) (provide cwd) --- end of file other-directory/b.rkt begin --- #lang racket (require "a.rkt) (print cwd) end --- To execute racket b.rkt

Re: [racket] how to create a ctype array

2012-12-13 Thread Jon Rafkind
_array produces a ctype, not an actual array itself. To get an array you can create one with malloc or you can call a C function through the ffi. If you use malloc then you get back a generic # type which you can convert to an array using ptr-ref as per the docs: "Since an array is treated like

[racket] how to create a ctype array

2012-12-13 Thread 刘海宽
in the reference, I see the _array function, but I don't understand well, when i try to do, always output errors, can anyone give me an example? here is my test in REPL:racket@> (_array _int 3)#racket@> (array? (_array _int 3))    ; why?#fracket@> Racket Users list: http://

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

2012-12-13 Thread David T. Pierson
On Fri, Dec 14, 2012 at 01:25:36AM -0500, 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 it

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

2012-12-13 Thread David T. Pierson
On Thu, Dec 13, 2012 at 03:34:36PM -0700, Jay McCarthy wrote: > You want handle-evt > > On Thu, Dec 13, 2012 at 3:27 PM, Ray Racine wrote: > > Using a Place or a Place-Channel as a sync event returns the value of a > > place-channel-get and not the Place itself. > > > > Most events return the act

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

2012-12-13 Thread Neil Van Dyke
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 that way, but no luck so far. Maybe this is something that modules

Re: [racket] SIGCHLD handler called in stderr

2012-12-13 Thread Matthew Flatt
At Sun, 9 Dec 2012 20:42:25 +0400, Sergey Khorev wrote: > Hi Matthew, > > >> if(-1 == write(2, "SIGCHLD handler called (some thread has SIGCHLD > >> unblocked)\n", 59)) { > > > > That message is meant to indicate that something has gone seriously > > wrong. > > > > Can you say more about your pl

Re: [racket] Passing info from reader level

2012-12-13 Thread Matthew Flatt
At Wed, 12 Dec 2012 01:01:18 -0800, Rajah Mahsohn Omega wrote: > Hi, I am creating my own language with racket, it's the same as racket > except that I can embed metadata anywhere in the code. I have implemented a > read and read-syntax function which detects the metadata and returns > (make-specia

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

2012-12-13 Thread Robby Findler
I think you want handle-evt, eg: (sync (handle-evt p1 (lambda (x) (list p1 x))) ) Robby On Thu, Dec 13, 2012 at 4:27 PM, Ray Racine wrote: > Using a Place or a Place-Channel as a sync event returns the value of a > place-channel-get and not the Place itself. > > Most events return the act

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

2012-12-13 Thread Jay McCarthy
You want handle-evt On Thu, Dec 13, 2012 at 3:27 PM, Ray Racine wrote: > Using a Place or a Place-Channel as a sync event returns the value of a > place-channel-get and not the Place itself. > > Most events return the actual `thing' which one sync'd on. This is not true > with places and channel

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

2012-12-13 Thread Ray Racine
Using a Place or a Place-Channel as a sync event returns the value of a place-channel-get and not the Place itself. Most events return the actual `thing' which one sync'd on. This is not true with places and channels, one gets the message itself. The conundrum is identification of which Place /

Re: [racket] lex-error report while reading HTML using module XML

2012-12-13 Thread Sam Tobin-Hochstadt
On Thu, Dec 13, 2012 at 9:17 AM, Stephen Bloch wrote: > > On Dec 12, 2012, at 11:42 PM, Haiwei Zhou wrote: > >> In HTML the tag has no end tag. > > Not exactly true. In XHTML (i.e. HTML >= 4.0, IIRC), it SHOULD have an end > tag -- as should every other tag in XHTML. You can do this either wit

Re: [racket] lex-error report while reading HTML using module XML

2012-12-13 Thread Stephen Bloch
On Dec 12, 2012, at 11:42 PM, Haiwei Zhou wrote: > In HTML the tag has no end tag. Not exactly true. In XHTML (i.e. HTML >= 4.0, IIRC), it SHOULD have an end tag -- as should every other tag in XHTML. You can do this either with or, briefer, with However, most or all browsers accept Web p