Re: [racket] FFI: problems using (_list i _string)

2011-06-06 Thread keydana
Hi Thomas, thanks so much for your introduction to memory management in FFI programming, which was very informative, concise and helpful indeed! It gives me a perfect starting point for exploring the topic. For the beginning, I think I'd be well advised, then, to explicitly call the ...Free() fu

Re: [racket] network server with places?

2011-06-06 Thread Jon Zeppieri
On Tue, Jun 7, 2011 at 1:09 AM, Jon Zeppieri wrote: > Sorry, after I wrote this, I realized that I had misread the types of > scheme_socket_to_ports() and scheme_socket_to_ports(). Err... that's scheme_get_port_socket() and scheme_socket_to_ports(). __

Re: [racket] network server with places?

2011-06-06 Thread Jon Zeppieri
Sorry, after I wrote this, I realized that I had misread the types of scheme_socket_to_ports() and scheme_socket_to_ports(). With the obvious adjustments, it works. Thanks again. On Tue, Jun 7, 2011 at 12:45 AM, Jon Zeppieri wrote: > OK, scheme_get_port_fd() seems consistently to return -1 for

Re: [racket] network server with places?

2011-06-06 Thread Jon Zeppieri
OK, scheme_get_port_fd() seems consistently to return -1 for ports returned by tcp-accept, so I'm trying instead to use scheme_get_port_socket() and scheme_socket_to_ports(). However, when I attempt to write to the resulting output port, I'm told that I'm writing to an invalid file descriptor. Exa

Re: [racket] network server with places?

2011-06-06 Thread Jon Zeppieri
Thanks! -J On Mon, Jun 6, 2011 at 9:24 AM, Matthew Flatt wrote: > I think places should somehow provide better support for this task. > > For now, using the FFI you could use scheme_get_port_fd() to extract a > TCP port's file descriptor as an integer, dup() it, send the dup()ed > integer to ano

Re: [racket] Bloom filter?

2011-06-06 Thread Pierpaolo Bernardi
On Mon, Jun 6, 2011 at 17:45, Robby Findler wrote: > On Mon, Jun 6, 2011 at 8:24 AM, Erich Rast wrote: >> I had something similar in mind but was wondering about the >> space-efficiency of a vector of booleans. Does the compiler represent >> this as a memory area where each boolean corresponds to

Re: [racket] Bloom filter?

2011-06-06 Thread Robby Findler
On Mon, Jun 6, 2011 at 8:24 AM, Erich Rast wrote: > I had something similar in mind but was wondering about the > space-efficiency of a vector of booleans. Does the compiler represent > this as a memory area where each boolean corresponds to a single bit? It does not. The simplest way to do somet

Re: [racket] Bloom filter?

2011-06-06 Thread Phil Bewig
R5RS doesn't provide bit operations or bit vectors. R6RS provides bit operations but not bit vectors. Thus, for my blog I used a vector of booleans; I'm more interested in the concept of bloom filters than the low-level implementation details. I don't know if Racket provides bit vectors. My Sta

Re: [racket] Bloom filter?

2011-06-06 Thread Erich Rast
Thanks a lot, that's a very nice place to start (interesting blog, too). I had something similar in mind but was wondering about the space-efficiency of a vector of booleans. Does the compiler represent this as a memory area where each boolean corresponds to a single bit? That would be cool but m

Re: [racket] Reading Graph Structure: read: #..= expressions not allowed in read-syntax mode (??)

2011-06-06 Thread Matthias Felleisen
Do you want something like this: #lang racket (struct dl (left node right) #:transparent #:mutable) (shared ((middle (dl left 1 right)) (left (dl #false 0 middle)) (right (dl middle 2 #false))) middle) On Jun 6, 2011, at 10:30 AM, Marijn wrote: > -BEGIN PGP SIG

Re: [racket] Bloom filter?

2011-06-06 Thread Phil Bewig
I implemented a spell checker using a Bloom filter at http://programmingpraxis.com/2009/04/21/probabilistic-spell-checking/. On Mon, Jun 6, 2011 at 9:48 AM, Erich Rast wrote: > Hi, > > I need to check whether a given string already occurs in a list of > several million strings, where occasional

Re: [racket] Reading Graph Structure: read: #..= expressions not allowed in read-syntax mode (??)

2011-06-06 Thread Eli Barzilay
25 minutes ago, Marijn wrote: > > My understanding is that it is a finite data structure that refers > to itself. It is supposed to represent 3 nodes/links of a doubly > linked list where each node points to its neighbours or #f, so > really it should only be 3 _dl's big... Yes, I know what you m

[racket] Bloom filter?

2011-06-06 Thread Erich Rast
Hi, I need to check whether a given string already occurs in a list of several million strings, where occasional false positives are acceptable. Before reinventing the wheel, has anybody already implemented a space-efficient Bloom filter in racket and would like to share it? Or, what else would

Re: [racket] Reading Graph Structure: read: #..= expressions not allowed in read-syntax mode (??)

2011-06-06 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/06/11 15:14, Eli Barzilay wrote: > 20 minutes ago, Marijn wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Hi, >> >> why does the following code >> >> >> #lang racket >> >> (struct _dl (left val right)) >> >> (define (dlist a b c)

Re: [racket] Reading Graph Structure: read: #..= expressions not allowed in read-syntax mode (??)

2011-06-06 Thread Matthew Flatt
At Mon, 6 Jun 2011 06:49:33 -0600, Jay McCarthy wrote: > Graph syntax is not allowed, but you be able to put it in a quote It doesn't work under quote, either. Graph syntax works only as input to `read' --- as opposed to `read-syntax' for code. Quoted cyclic syntax used to work, but cyclic consta

Re: [racket] network server with places?

2011-06-06 Thread Matthew Flatt
I think places should somehow provide better support for this task. For now, using the FFI you could use scheme_get_port_fd() to extract a TCP port's file descriptor as an integer, dup() it, send the dup()ed integer to another place, and create new ports using scheme_make_fd_input_port() and schem

[racket] Reading Graph Structure: read: #..= expressions not allowed in read-syntax mode (??)

2011-06-06 Thread Eli Barzilay
20 minutes ago, Marijn wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > why does the following code > > > #lang racket > > (struct _dl (left val right)) > > (define (dlist a b c) > #1=(_dl #f a #2=(_dl #1# b (_dl #2# c #f))) ) Note that you wrote an infinite piece of co

Re: [racket] Reading Graph Structure: read: #..= expressions not allowed in read-syntax mode (??)

2011-06-06 Thread Jay McCarthy
Graph syntax is not allowed, but you be able to put it in a quote iPhoneから送信 On 2011/06/06, at 6:48, Marijn wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > why does the following code > > > #lang racket > > (struct _dl (left val right)) > > (define (dlist a b c) > #1

[racket] Reading Graph Structure: read: #..= expressions not allowed in read-syntax mode (??)

2011-06-06 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, why does the following code #lang racket (struct _dl (left val right)) (define (dlist a b c) #1=(_dl #f a #2=(_dl #1# b (_dl #2# c #f))) ) produce the error: Module Language: invalid module text . read: #..= expressions not allowed in rea

Re: [racket] Sieve...

2011-06-06 Thread Eli Barzilay
40 minutes ago, Neil Van Dyke wrote: > Eli Barzilay wrote at 06/06/2011 07:05 AM: > > Four hours ago, John Clements wrote: > > > >> RFC 5228, a DSL for mail processing. Very tidy, *perfect* DSL > >> domain. Could have been nice > > > > There's about 200 similar DSLs around anything that's re

Re: [racket] Sieve...

2011-06-06 Thread Neil Van Dyke
Eli Barzilay wrote at 06/06/2011 07:05 AM: Four hours ago, John Clements wrote: RFC 5228, a DSL for mail processing. Very tidy, *perfect* DSL domain. Could have been nice There's about 200 similar DSLs around anything that's related to email... And some of them are among the m

Re: [racket] Sieve...

2011-06-06 Thread Eli Barzilay
Four hours ago, John Clements wrote: > RFC 5228, a DSL for mail processing. Very tidy, *perfect* DSL > domain. Could have been nice There's about 200 similar DSLs around anything that's related to email... -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:

Re: [racket] Sieve...

2011-06-06 Thread Neil Van Dyke
I think that nothing is stopping someone from implementing an elegant DSL with similar intent in Racket. They could use it in a Racket-based replacement for Mailman (or a full-fledged MTA, or the existing Racket-based MUA). If they ever need to use this Sieve language for interoperation, they

Re: [racket] Bug or feature?

2011-06-06 Thread Antonio Menezes Leitao
Hi, On Mon, Jun 6, 2011 at 8:37 AM, Marijn wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Ho Antonio, > > you didn't specify a version or give actual output of your program. Indeed, I forgot that. The following output was generated with DrRacket 5.1.1 in Window 7 while moving the

Re: [racket] Bug or feature?

2011-06-06 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ho Antonio, you didn't specify a version or give actual output of your program. On my racket (git version of perhaps one or two weeks old) I don't see what you describe. If I run the program, an (annoyingly small) window is created and if I click and

[racket] Sieve...

2011-06-06 Thread John Clements
RFC 5228, a DSL for mail processing. Very tidy, *perfect* DSL domain. Could have been nice Ah well. John Clements smime.p7s Description: S/MIME cryptographic signature _ For list-related administrative tasks: http://lists.racket-lang.org