Re: [racket-users] macro making a struct with a macro

2015-08-17 Thread Deren Dohoda
Thanks for your help Alexander. I did have this much working alright in a different manner. What I guess I wanted was that this syntax was introduced per struct so that the same syntax worked for all interface-structs. That is, if I (interface-struct test (a b c) [(define

[racket-users] Capability security in Racket?

2015-08-17 Thread Sean Lynch
Hi, folks. I'd like to implement an LPMUD-like multi-user programmable environment in Racket. The idea is that an object would be a module plus some state, similar to a gen_server in Erlang. Objects would each live in their own sandbox and communicate with one another via message passing, probably

Re: [racket-users] Match value of symbol vs. binding to it

2015-08-17 Thread Brian Adkins
On Tuesday, August 18, 2015 at 1:24:38 AM UTC-4, Alex Knauth wrote: On Aug 18, 2015, at 1:18 AM, Brian Adkins lojicdot...@gmail.com wrote: On Tuesday, August 18, 2015 at 1:13:16 AM UTC-4, Alex Knauth wrote: Is == what you're looking for? Or do you want a version of == that uses string=? ?

Re: [racket-users] Using the draw and plot packages with other languages

2015-08-17 Thread WarGrey Gyoudmon Ju
On Sun, Aug 16, 2015 at 6:40 AM, Marduk Bolaños mardu...@gmail.com wrote: Coming back to my original question. What is your advice for using Racket's draw and plot in other programs? Hi, Marduk. There was a discussion that is close to your purpose.

Re: [racket-users] macro making a struct with a macro

2015-08-17 Thread Alexander D. Knauth
Are you looking for a macro like this: #lang racket (require syntax/parse/define (for-syntax racket/syntax)) (define-simple-macro (define-struct-fields struct:id (field:id ...) v:expr) #:with s (generate-temporary #'struct) #:with [struct-field ...] (for/list ([field (in-list (syntax-list

[racket-users] macro making a struct with a macro

2015-08-17 Thread Deren Dohoda
Suppose I have a struct which implements a generic interface. I'll copy and paste the interface from the guide for the example. What I'd like to do is have automatically-introduced syntax which allows you to skip a lot of the struct-accessor forms. So for instance, for a struct like (struct test

[racket-users] Garbage Collection of Places

2015-08-17 Thread Tim Brown
Folks, I am observing a memory leak with place-channels. I have long-lived (or very busy server “places”) which I think are exhausting VM memory and causing spectacular failures -- core dumps, spins and other fun I came to Racket to avoid. Please could someone more familiar with the code take a

Re: [racket-users] Using the draw and plot packages with other languages

2015-08-17 Thread Marduk Bolaños
Great! Thank you! Best, Marduk -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit

Re: [racket-users] About Web-Server API

2015-08-17 Thread Jay McCarthy
There's nothing experimental or especially teaching oriented in the API. It is as useful as PHP and Python's. I personally think it is more useful because of some special Racket-y things it does, but I'm obviously biased. Jay On Mon, Aug 17, 2015 at 3:41 AM, sagyo12341...@gmail.com wrote: Hi,

[racket-users] Re: Garbage Collection of Places

2015-08-17 Thread Tim Brown
On 17/08/15 15:02, Tim Brown wrote: I am observing a memory leak with place-channels. I have long-lived (or very busy server “places” ) which I think are exhausting VM memory and causing spectacular failures -- core dumps, spins and other fun I came to Racket to avoid. Please could someone

[racket-users] Re: Garbage Collection of Places

2015-08-17 Thread Tim Brown
On 17/08/15 15:15, Tim Brown wrote: To explain my need of insane numbers of places, I [...] I mean place-channels, the population of places is fixed. -- Tim Brown CEng MBCS tim.br...@cityc.co.uk City

Re: [racket-users] pkg version exceptions: ranges of versions?

2015-08-17 Thread Jay McCarthy
This is not currently a feature. Jay On Sun, Aug 16, 2015 at 11:09 AM, Alexander D. Knauth alexan...@knauth.org wrote: Is there a way to create a version exception for a range of versions, instead of for a single version? -- You received this message because you are subscribed to the

[racket-users] Match value of symbol vs. binding to it

2015-08-17 Thread Brian Adkins
Consider the following: (define x abc) (match '(1 abc) [ (list 1 y) #:when (string=? y x) #t ] [ _ #f ]) Is there a way to accomplish the same thing more concisely by interpolating the value of x into the pattern? For example (non-working syntax): (define x abc) (match '(1 abc) [ (list 1

Re: [racket-users] Match value of symbol vs. binding to it

2015-08-17 Thread Alexander D. Knauth
On Aug 18, 2015, at 1:18 AM, Brian Adkins lojicdot...@gmail.com wrote: On Tuesday, August 18, 2015 at 1:13:16 AM UTC-4, Alex Knauth wrote: Is == what you're looking for? Or do you want a version of == that uses string=? ? I'm not sure what you're suggesting. I basically want a way to

Re: [racket-users] macro making a struct with a macro

2015-08-17 Thread Deren Dohoda
Very helpful, thank you. You're right that the #:methods spec was messing up the original macro, too. Though it had some other problems after I got beyond that hurdle. Every time I think I am starting to understand macros I find out I don't. Deren On Tue, Aug 18, 2015 at 12:43 AM, Alexander D.

Re: [racket-users] Match value of symbol vs. binding to it

2015-08-17 Thread Brian Adkins
On Tuesday, August 18, 2015 at 1:13:16 AM UTC-4, Alex Knauth wrote: Is == what you're looking for? Or do you want a version of == that uses string=? ? I'm not sure what you're suggesting. I basically want a way to inject the value of x into the pattern vs. using a literal such as abc since I

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Tim Brown
Sam, I don’t see the leak with (display (current-memory-use)) -- sorry for leaving it in the example, it’s misleading since your numbers behave like mine did when I used that function. I *do*, however, see the leak on my gnome-system-monitor; which looks like something that’s invisible to the GC

Re: [racket-users] HTTPS connection through proxy (CONNECT HTTP Method)

2015-08-17 Thread Jay McCarthy
It sounds like you are on the right track. If you need help and can provide a test case, then I'd be able to be more useful. I think the function you're going to want to get out is something like: http-conn-tunnel/ssl : http-conn [arguments to ports-ssl-ports] - http-conn where the input port is

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Matthew Flatt
The problem is in the clean-up of OS-level locks. A lock is allocated using a combination of malloc() and pthread_mutex_init(), for example. The clean up was usually missing the free() to go along with pthread_mutex_destroy(). That's an especially basic mistake, and it slipped by because

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Matthew Flatt
I'm looking into this. I can confirm that the GC thinks there's no leak, but the OS thinks there is. Thanks for the example and info! At Mon, 17 Aug 2015 16:09:00 +0100, Tim Brown wrote: Sam, I don’t see the leak with (display (current-memory-use)) -- sorry for leaving it in the example,

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Tim Brown
Thank you Matthew. On 17/08/15 17:07, Matthew Flatt wrote: That's an especially basic mistake, and it slipped by because low-level locks are rarely allocated in the run-time system. Place channels are probably the simplest way to trigger new locks, but the test that checks for leaks with

[racket-users] About Web-Server API

2015-08-17 Thread sagyo12341234
Hi, I want to build my web server in internet and make a simple blog page. Is the racket's web server API useful as php or python, or experimental or for teaching? -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Jack Firth
On Monday, August 17, 2015 at 9:07:15 AM UTC-7, Matthew Flatt wrote: That's an especially basic mistake, and it slipped by because low-level locks are rarely allocated in the run-time system. Place channels are probably the simplest way to trigger new locks, but the test that checks for leaks

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Neil Van Dyke
Jack Firth wrote on 08/17/2015 03:21 PM: From my limited experience with C, I've learned it's pretty much impossible to expect any sane human to keep track of memory perfectly. That's a helpful impression. C must be feared and respected, before it can be tamed. That said, I think it's

Re: [racket-users] About Web-Server API

2015-08-17 Thread sagyo12341234
Thank you, Jay. I'll try it. 2015年8月17日月曜日 23時45分07秒 UTC+9 Jay McCarthy: There's nothing experimental or especially teaching oriented in the API. It is as useful as PHP and Python's. I personally think it is more useful because of some special Racket-y things it does, but I'm obviously

Re: [racket-users] pkg version exceptions: ranges of versions?

2015-08-17 Thread Leif Andersen
In that case is it possible to have a version for HEAD, or at least the latest nightlies, as those version numbers tend to change quite rapidly? ~Leif Andersen On Mon, Aug 17, 2015 at 10:47 AM, Jay McCarthy jay.mccar...@gmail.com wrote: This is not currently a feature. Jay On Sun, Aug 16,