Re: [racket] Improvement of a syntax-parse syntax class definition

2014-06-26 Thread Alexander D. Knauth
Well, I made my own modified version of syntax/parse that lets you define ~separated as a pattern-expander that let’s you do this: #lang racket (require (for-syntax syntax-parse-with-pattern-expanders (for-syntax racket/base))) (begin-for-syntax (define-splicing-syntax-clas

Re: [racket] Style guide and inner definitions

2014-06-26 Thread Greg Hendershott
With something that big, I will often: - Move that function to its own new .rkt file. - Move the inner functions out to the module level, too (as "siblings" not "kids"). - Provide only the main one, e.g. `(provide process-elements)`. As a bonus, now it's easier to exercise the helper functions in

[racket] Style guide and inner definitions

2014-06-26 Thread Roman Klochkov
Racket Style Guide http://www.ccs.neu.edu/home/matthias/Style/style/Units_of_Code.html in section 3.2 recommends to use functions below 66 lines. But usually fuinctions are like this: (define (process-elements elements)            (define (process-one ...) ...)      (define (check-element ..

[racket] Improvement of a syntax-parse syntax class definition

2014-06-26 Thread Jens Axel Søgaard
Hi All, The example program below defines a macro, my-let, that enables you to write let-bindings with / as a separator. (my-let (x = 1 / y = 2 / z = 3) (+ x y z)) I'd like to improve the definition of the syntax class called bindings. Ideally I'd like to replace its definition with:

[racket] ICFP 2014 Call for Participation

2014-06-26 Thread David Van Horn
[ Please note that much of the block reservation of hotel rooms currently being held for ICFP participants will be released next week. The beginning of September is a very busy conference week in Göteborg, so there is high pressure on hotel rooms in that period. If you plan to attend ICFP

Re: [racket] Regex golf: 25x slowdown compared to Python?!

2014-06-26 Thread Laurent
Oh woah! Thank you very much Matthew! What a relief :) I thought I had tried that, but looks like I didn't... (my hash table was probably misplaced and your solution is neater anyway) Laurent On Thu, Jun 26, 2014 at 6:35 PM, Matthew Flatt wrote: > Instead of passing a string directly as the f

Re: [racket] Python creep

2014-06-26 Thread Jean-Paul . ROY
There has been an interesting MOOC on Scheme functional recursive programming from Univ. Pierre and Marie Curie (Paris-6), in France this year (in French) with automated correction of student programmed functions with tests. The author was Christian Queinnec, professor at Paris-6. There was a sa

Re: [racket] Regex golf: 25x slowdown compared to Python?!

2014-06-26 Thread Matthew Flatt
Instead of passing a string directly as the first argument to `regexp-match`, use `regexp` to convert the string to a regexp value if you want to use it multiple times. Changing (define (matches rx lstr) (filter (λ(w)(regexp-match? rx w)) lstr)) to (define (matches rx-str lstr) (define

[racket] Regex golf: 25x slowdown compared to Python?!

2014-06-26 Thread Laurent
Hi, While translating (almost literally) Norvig's awesome regex golf from Python [1] to Racket [2], I'm facing a 25x slowdown (about 2s vs 50s). I've run the optimization coach and made the obvious changes (mainly adding `in-list` in `for` loops), tried to optimize `filter` and cache the regexps i

Re: [racket] file-date

2014-06-26 Thread Matthew Flatt
`file-or-directory-modify-seconds` I'll add an index entry so that a search for "file date" find that function. At Thu, 26 Jun 2014 10:24:19 +0200 (CEST), jvjul...@free.fr wrote: > Hello, > > Is there a way to know the last modification date of a file ? > > Thanks for your help > > jeeve > ___

[racket] file-date

2014-06-26 Thread jvjulien
Hello, Is there a way to know the last modification date of a file ? Thanks for your help jeeve Racket Users list: http://lists.racket-lang.org/users