Re: [racket-users] help on coding finite state automata

2015-09-04 Thread Nguyen Linh Chi
Dear mrmyers, I cloned your repo however it's true that i complete have no idea about macro yet. It'd be nice for further reading as i'd work on this problem for long. As soegaard suggests on IRC, to avoid the problem of creating new machines after every interaction, i'd try to make the struct

Re: [racket-users] Macro-generating macros

2015-09-04 Thread Alexander D. Knauth
> On Sep 4, 2015, at 4:26 AM, Konrad Hinsen wrote: > > Brian Mastenbrook writes: > >> It's a capture problem. In the first case, you're just binding the >> name "send" locally and all is well. In the second case, you're >> trying to introduce a binding for "send"

Re: [racket-users] help on coding finite state automata

2015-09-04 Thread Jens Axel Søgaard
Hi Linh, There are many different representations of finite state machines. If you "just" need to simulate a single machine, a simple and efficient approach is to represent each state as a Racket function (see example below). #lang racket (require racket/generator) ;; The turn-stile example

[racket-users] Re: Official Docker images for Racket

2015-09-04 Thread Juan Francisco Cantero Hurtado
On 09/03/2015 08:07 AM, Jack Firth wrote: I've attempted to compile from source in an alpine image, but with no success. There's a bit too much arcane magic there for me to figure out how to do that. Can you show the errors on Alpine? Are you using Alpine in a container or in a virtual/real

Re: [racket-users] Issues with `head-pure-port'

2015-09-04 Thread Jay McCarthy
On Fri, Sep 4, 2015 at 3:05 AM, Tim Brown wrote: > Folks, > > I have just tried to HEAD a web server, and have come across a few > issues around the use of head-pure-port: > > 1. What is the point of `head-pure-port'? The HTTP server should not >(must not?) send a body. Which

Re: [racket-users] Macro-generating macros

2015-09-04 Thread William Cushing
Racket's syntax-expander deliberately goes out of its way to break exactly this example. ("hygiene") The issue/bug/ambiguity it is protecting you from is: (let ((send (lambda args (length args)) )) (def (foo3 x y) (send x + y) )) (foo3 2 3) ;; In lisps with poor grooming, 5.

[racket-users] Re: help on coding finite state automata

2015-09-04 Thread Michael Myers
You might want to take a look at https://github.com/mromyers/automata specifically, https://github.com/mromyers/automata/blob/master/examples.rkt and https://github.com/mromyers/automata/blob/master/machines.rkt I more or less just use the definition that was in my textbook: you provide a

Re: [racket-users] Macro-generating macros

2015-09-04 Thread Konrad Hinsen
Alexander D. Knauth writes: > > At least it's one that works. It feels like cheating to use dynamic > > scoping to get around a problem with lexical scoping, but knowing when > > to cheat is a fundamental competence when dealing with any bureaucracy ;-) > > Um, the reason a syntax parameter

[racket-users] Re: help on coding finite state automata

2015-09-04 Thread mrmyers . random . suffix
On Friday, September 4, 2015 at 9:31:36 AM UTC-4, Michael Myers wrote: > You might want to take a look at https://github.com/mromyers/automata > specifically, https://github.com/mromyers/automata/blob/master/examples.rkt > and https://github.com/mromyers/automata/blob/master/machines.rkt > > I

[racket-users] Re: Official Docker images for Racket

2015-09-04 Thread Juan Francisco Cantero Hurtado
On 09/04/2015 04:59 PM, Jack Firth wrote: On Friday, September 4, 2015 at 4:51:43 AM UTC-7, Juan Francisco Cantero Hurtado wrote: On 09/03/2015 08:07 AM, Jack Firth wrote: I've attempted to compile from source in an alpine image, but with no success. There's a bit too much arcane magic there

[racket-users] Re: Official Docker images for Racket

2015-09-04 Thread Jack Firth
On Friday, September 4, 2015 at 4:51:43 AM UTC-7, Juan Francisco Cantero Hurtado wrote: > On 09/03/2015 08:07 AM, Jack Firth wrote: > > I've attempted to compile from source in an alpine image, but with no > > success. There's a bit too much arcane magic there for me to figure out how > > to do

[racket-users] Re: Official Docker images for Racket

2015-09-04 Thread Jack Firth
On Friday, September 4, 2015 at 8:23:14 AM UTC-7, Juan Francisco Cantero Hurtado wrote: > On 09/04/2015 04:59 PM, Jack Firth wrote: > > On Friday, September 4, 2015 at 4:51:43 AM UTC-7, Juan Francisco Cantero > > Hurtado wrote: > >> On 09/03/2015 08:07 AM, Jack Firth wrote: > >>> I've attempted

Re: [racket-users] Re: help on coding finite state automata

2015-09-04 Thread mrmyers . random . suffix
On Friday, September 4, 2015 at 1:34:38 AM UTC-4, Linh Chi Nguyen wrote: > Wow as much as i appreciate and try to see through all the answers, i have to > confess that i'm a first year Phd student in economics. So writing macro is > too far for me now. > > I'd just process with struct.. And see

[racket-users] Issues with `head-pure-port'

2015-09-04 Thread Tim Brown
Folks, I have just tried to HEAD a web server, and have come across a few issues around the use of head-pure-port: 1. What is the point of `head-pure-port'? The HTTP server should not (must not?) send a body. Which means that once the port is purified, `head-pure-port' returns nothing. So

Re: [racket-users] Macro-generating macros

2015-09-04 Thread Konrad Hinsen
Brian Mastenbrook writes: > It's a capture problem. In the first case, you're just binding the > name "send" locally and all is well. In the second case, you're > trying to introduce a binding for "send" that you didn't get from > the input form. Ahhh that one has bitten me before, but I