[racket] find-executable-path does not work on Windows for me

2014-07-12 Thread Mangpo Phitchaya Phothilimthana
I have issue with find-executable-path function on Windows. I update Windows's environment path to include the path to executable I want to run, and verify that it is indeed added via run->cmd. However, when I call find-executable-path on that executable, it returns #f. Even when I move the executa

Re: [racket] Pattern matching define macro

2014-07-12 Thread Alexander D. Knauth
On Jul 12, 2014, at 10:17 PM, Alexander D. Knauth wrote: > > On Jul 12, 2014, at 6:43 PM, Brian Adkins wrote: > >> I probably won't keep my defpat macro, at least not in its present form (for >> one, it only handles a single arg); there's probably a balance between being >> concise and bein

Re: [racket] Pattern matching define macro

2014-07-12 Thread Alexander D. Knauth
On Jul 12, 2014, at 6:43 PM, Brian Adkins wrote: > On Jul 12, 2014, at 6:19 PM, Daniel Prager wrote: > >> Hi Brian >> >> r >= 0 && r <= 4 && c >= 0 && c <= r >> >> >> implies >> >> 0 <= c <= r <= 4 >> >> >> Or using prefix and the variable-arity of <=: >> >> (define (is-pos r c) >> (<=

Re: [racket] Pattern matching define macro

2014-07-12 Thread Brian Adkins
On Jul 12, 2014, at 6:17 PM, Asumu Takikawa wrote: > On 2014-07-12 16:18:55 -0400, Brian Adkins wrote: >> 1) It's odd to me to specify the l argument, and then never refer to it. >> 2) The syntax of the former seems less "noisy". > > I agree that the syntax can be noisy for simple cases. > > The

Re: [racket] Pattern matching define macro

2014-07-12 Thread Brian Adkins
On Jul 12, 2014, at 6:19 PM, Daniel Prager wrote: > Hi Brian > > r >= 0 && r <= 4 && c >= 0 && c <= r > > > implies > > 0 <= c <= r <= 4 > > > Or using prefix and the variable-arity of <=: > > (define (is-pos r c) > (<= 0 c r 4)) > > > which I think works well for clarity, concision, an

Re: [racket] Pattern matching define macro

2014-07-12 Thread Daniel Prager
Hi Brian r >= 0 && r <= 4 && c >= 0 && c <= r implies 0 <= c <= r <= 4 Or using prefix and the variable-arity of <=: (define (is-pos r c) (<= 0 c r 4)) which I think works well for clarity, concision, and efficiency. Dan Racket Users list: http://lists.racket-l

Re: [racket] Pattern matching define macro

2014-07-12 Thread Asumu Takikawa
On 2014-07-12 16:18:55 -0400, Brian Adkins wrote: > 1) It's odd to me to specify the l argument, and then never refer to it. > 2) The syntax of the former seems less "noisy". I agree that the syntax can be noisy for simple cases. The design rationale for having the header is to allow optional, ke

Re: [racket] Pattern matching define macro

2014-07-12 Thread Neil Van Dyke
Brian Adkins wrote at 07/12/2014 04:19 PM: Thanks for the advice Neil. I'm a little confused by your "Racket is an imperative language" statement though - it seems quite "functional" to me, which was one of the attractions. [...] Racket can be used as a functional language, so long as one rem

Re: [racket] Pattern matching define macro

2014-07-12 Thread Brian Adkins
Thanks for the advice Neil. I'm a little confused by your "Racket is an imperative language" statement though - it seems quite "functional" to me, which was one of the attractions. The Haskell code was written a few years ago, as a relative newbie, as an exercise in emphasizing readability and

Re: [racket] Pattern matching define macro

2014-07-12 Thread Brian Adkins
Thanks. I did look at define/match but: (defpat (is-pos (list r c)) (and (member r (lgen 0 4)) (member c (lgen 0 r seems nicer to me than: (define/match (is-pos l) [((list r c)) (and (member r (lgen 0 4)) (member c (lgen 0 r)))]) for two reasons: 1) It's odd to

[racket] Fwd: Pattern matching define macro

2014-07-12 Thread Brian Adkins
I'm not used to the reply-to begin set to the individual vs. the list for racketusers, so I'll forward a few replies... Begin forwarded message: > From: Brian Adkins > On Jul 12, 2014, at 1:17 PM, Matthias Felleisen wrote: >> On Jul 12, 2014, at 12:53 PM, Brian Adkins wrote: >> >>> I'm porting

Re: [racket] something like a prop:object-name?

2014-07-12 Thread J. Ian Johnson
Why is it a name per type? That seems wrong, since a function with docstring struct should have the object-name of the function, or something refined. The struct itself could be used for potentially every function a user writes, rendering object-name overly vague. -Ian - Original Message ---

Re: [racket] something like a prop:object-name?

2014-07-12 Thread Sam Tobin-Hochstadt
This doesn't count as "soon", but I finally cleaned up my patch for this: https://github.com/plt/racket/pull/729 It's not as general as what Alexander envisioned, so it should probably be generalized. Sam On Wed, Apr 30, 2014 at 5:13 PM, Sam Tobin-Hochstadt wrote: > I've written 75% of a patch

Re: [racket] Pattern matching define macro

2014-07-12 Thread Neil Van Dyke
Complementary to the suggestions that Matthias and Jens Axel made, also remember that Racket has a very different evaluation model than Haskell. Consider reworking the use of the "and" form and everything within it: instead, test "r" and "c" for "integer?", and then use "<=" and ">=" to determ

Re: [racket] Announce: multiplayer networked coop game in racket

2014-07-12 Thread Alexander McLin
This is fun! I loved how my screen would shake and flicker each time I get slammed by a fire volley. Certainly got my adrenaline pumping. On Sat, Jul 12, 2014 at 12:01 PM, David Vanderson wrote: > For the past 6 months my hobby has been writing the beginnings of a > lan-party game in Racket: >

Re: [racket] Pattern matching define macro

2014-07-12 Thread Jens Axel Søgaard
Hi Brian, I think you want define/match. (define/match (is-pos l) [((list r c)) (and (member r (range 0 4)) (member c (range 0 r)))]) (is-pos '(2 5)) ; => #f (is-pos '(2 1)) ; => '(1) /Jens Axel 2014-07-12 18:53 GMT+02:00 Brian Adkins : > I'm porting more Haskell code

Re: [racket] Pattern matching define macro

2014-07-12 Thread Matthias Felleisen
On Jul 12, 2014, at 12:53 PM, Brian Adkins wrote: > I'm porting more Haskell code to Racket as a learning exercise. When I got to > this line: > > isPos (r,c) = elem r [0..4] && elem c [0..r] > > I first wrote this: > > (define (is-pos r c) (and (member r (lgen 0 4)) >

[racket] Pattern matching define macro

2014-07-12 Thread Brian Adkins
I'm porting more Haskell code to Racket as a learning exercise. When I got to this line: isPos (r,c) = elem r [0..4] && elem c [0..r] I first wrote this: (define (is-pos r c) (and (member r (lgen 0 4)) (member c (lgen 0 r where lgen is: (define (lgen m n) (build-

Re: [racket] Hierarchical loggers

2014-07-12 Thread Greg Hendershott
> The `configure-runtime` submodule name is special: when "main.rkt" is > run as a program, then `configure-runtime` is loaded and instantiated > first --- before the result of "main.rkt", and before the imported > "foo.rkt" and "bar.rkt" modules. > > This strategy only makes sense for configuratio

Re: [racket] Hierarchical loggers

2014-07-12 Thread Aidan Gauland
Matthew Flatt writes: > Every once in a while, I find that option 2 works well with the pattern > > foo.rkt: >#lang racket >(define-logger foo) ; uses `(current-logger)` > > bar.rkt: >#lang racket >(define-logger bar) ; uses `(current-logger)` > > main.rkt: >#lang racket >

[racket] Call for participation: Workshop on Generic Programming

2014-07-12 Thread José Pedro Magalhães
== CALL FOR PARTICIPATION WGP 2014 10th ACM SIGPLAN Workshop on Generic Programming Gothenburg, Sweden Sunday,