Re: [racket-users] Simple regex question. How to match this: "[X] foo"

2016-01-08 Thread Alexis King
> You could make a Racket reader that did this. Or you can find some of the > interesting s-expression regular expression languages (I think Olin Shivers > did one). Or just not use regexps so much > ("http://regex.info/blog/2006-09-15/247”). When telling someone to avoid something useful, it

Re: [racket-users] Simple regex question. How to match this: "[X] foo"

2016-01-08 Thread Neil Van Dyke
David Storrs wrote on 01/09/2016 02:34 AM: What method would you suggest for that? Probably regular expression. :) Neil V. -- 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, s

Re: [racket-users] Simple regex question. How to match this: "[X] foo"

2016-01-08 Thread David Storrs
On Fri, Jan 8, 2016 at 10:56 PM, Neil Van Dyke wrote: > David Storrs wrote on 01/09/2016 01:38 AM: > >> >> (regex-match* >> #px"\[[xX\d]\]" >> "[1] foo \n [2] bar \n [x] baz \n [X] baz \n"") >> > > (regexp-match* > #px"\\[[xX\\d]\\]" > "[1] foo \n [2] bar \n [x] baz \n [X] baz \n") > ;;

Re: [racket-users] Simple regex question. How to match this: "[X] foo"

2016-01-08 Thread Neil Van Dyke
David Storrs wrote on 01/09/2016 01:38 AM: (regex-match* #px"\[[xX\d]\]" "[1] foo \n [2] bar \n [x] baz \n [X] baz \n"") (regexp-match* #px"\\[[xX\\d]\\]" "[1] foo \n [2] bar \n [x] baz \n [X] baz \n") ;;==> ("[1]" "[2]" "[x]" "[X]") Looks like maybe a typo in the procedure name, an

[racket-users] Simple regex question. How to match this: "[X] foo"

2016-01-08 Thread David Storrs
I'm having some trouble with the syntax for regexen, and the docs are a bit opaque on this point. Given this: (regex-match* #px"\[[xX\d]\]" "[1] foo \n [2] bar \n [x] baz \n [X] baz \n"") I'm expecting it to return: ( "[1]" "[2]" "[x]" "[X]") Instead it complains about undefined identi

Re: [racket-users] HTTPS for Racket web sites and packages

2016-01-08 Thread Neil Van Dyke
Matthew Flatt wrote on 01/08/2016 10:54 PM: Except for "https://mirror.racket-lang.org";, HTTPS content is provided via CloudFlare from an HTTP (not HTTPS) access of S3. So, you can only trust the content of "https://pkgs.racket-lang.org"; to the degree that you trust Amazon, CloudFlare, and the

[racket-users] HTTPS for Racket web sites and packages

2016-01-08 Thread Matthew Flatt
Sam, Ryan, I, and others have been moving Racket services to HTTPS: https://racket-lang.org/ We're changing all references to use HTTPS, so if you go to "http://racket-lang.org"; (no "s"), the "Download" link takes you to "https://download.racket-lang.org/";. The default download button on that

Re: [racket-users] upload file with http post an Content-Type is multipart/form

2016-01-08 Thread Neil Van Dyke
One problem is that you should have *two* CR-LF byte sequences to terminate the header list in each MIME multipart part. For example, instead of: "--" boundary CRLF "Content-Disposition: form-data; name=\"file\"; filename=\"And360.zip\"" CRLF "Content-Type: application/zip" CRLF))

[racket-users] upload file with http post an Content-Type is multipart/form

2016-01-08 Thread 刘海宽
Hi, I have a problem when upload file through http post method. Here is my code: #lang racket (require net/uri-codec) (require net/url) (require json) (require net/http-client) (define (->string bs) (if (bytes? bs) (bytes->string/utf-8 bs) bs)) (define (->bytes str) (cond [(s

Re: [racket-users] Can I cross-compile racket code?

2016-01-08 Thread DonRyuDragoni
My major problem is Mac, actually. We do have a Windows machine, I just prefer to code on Linux. And, of course, it would make things easier if I could run one command and wait until all executables are created. -- You received this message because you are subscribed to the Google Groups "Ra

Re: [racket-users] Counterintuitive performance results

2016-01-08 Thread Andrew Kent
On Friday, January 8, 2016 at 4:40:05 PM UTC-5, Alex Knauth wrote: > I tried doing stuff, but then I realized that there's a typo that messes this > up. > > > On Jan 8, 2016, at 4:29 PM, Andrew Kent wrote: > > > > Any guesses why adding more indirection speeds up the code here? > > > > #lang r

Re: [racket-users] Counterintuitive performance results

2016-01-08 Thread Alex Knauth
I tried doing stuff, but then I realized that there's a typo that messes this up. > On Jan 8, 2016, at 4:29 PM, Andrew Kent wrote: > > Any guesses why adding more indirection speeds up the code here? > > #lang racket > > (define (set-members? s . xs) > (for/and ([x (in-list xs)]) >(set-

Re: [racket-users] Counterintuitive performance results

2016-01-08 Thread Pierpaolo Bernardi
I tried swapping the two expressions. The result is that the one executing first is always slower than the one executing second. So, probably the timing is dominated by some memory/GC/locality effect rather than the difference between set-member? and set-members? On Fri, Jan 8, 2016 at 10:29 PM,

[racket-users] Counterintuitive performance results

2016-01-08 Thread Andrew Kent
Any guesses why adding more indirection speeds up the code here? #lang racket (define (set-members? s . xs) (for/and ([x (in-list xs)]) (set-member? xs x))) (define s (set-add (for/set ([i (in-range 1000)]) (random 1)) 333)) (collect-garbage) (time

Re: [racket-users] Simple question on begin and call-by-value

2016-01-08 Thread Eduardo Bonelli
Dear William, You are quite right. Sorry for the silly question and thanks for the quick reply. E. On Friday, January 8, 2016 at 6:05:35 PM UTC-3, William J. Bowman wrote: > ((lambda x x) (void)) returns a list containing the void object. Perhaps you > meant (lambda (x) (begin x))

Re: [racket-users] Simple question on begin and call-by-value

2016-01-08 Thread 'William J. Bowman' via Racket Users
On Fri, Jan 08, 2016 at 12:58:14PM -0800, Eduardo Bonelli wrote: > Hello, > > Why do the values of these two expressions differ? > > > (begin (void)) > > ((lambda x (begin x)) (void)) > '(#) > > In the second case, I understand that CBV would evaluate the argument > "(void)" to obtain

[racket-users] Simple question on begin and call-by-value

2016-01-08 Thread Eduardo Bonelli
Hello, Why do the values of these two expressions differ? > (begin (void)) > ((lambda x (begin x)) (void)) '(#) In the second case, I understand that CBV would evaluate the argument "(void)" to obtain the (untyped) value "#". It then passes this on to the function "((lambda x (begin

Re: [racket-users] Cycle in loading. Units, (sub)modules, files...

2016-01-08 Thread Jonas Winje
Thanks. And like, that sounds a lot more sensible than what I'm trying to do :) And what I'm trying to do doesn't strike me as generally a good idea, but... Initially I was playing around with language-stuff. Was making a language and wanted a file written in that language to define a signature a

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-08 Thread Sam Tobin-Hochstadt
On Fri, Jan 8, 2016 at 10:10 AM, Robby Findler wrote: > I think we must be talking past each other. Let me try to back out a bit. > > It is my understanding that the trie library's slowness that John > reported is all about contract overhead. Specifically, there are some > (effectively) lazy contr

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-08 Thread Robby Findler
I think we must be talking past each other. Let me try to back out a bit. It is my understanding that the trie library's slowness that John reported is all about contract overhead. Specifically, there are some (effectively) lazy contracts on the trie structs that pile up, leading to surprisingly b

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-08 Thread Robby Findler
I thought your suggestion involved a change to TR. But whatever. Do what you want. Robby On Fri, Jan 8, 2016 at 8:45 AM, Sam Tobin-Hochstadt wrote: > This library isn't part of the Racket distribution, so the release schedule > doesn't really matter here. > > Sam > > On Fri, Jan 8, 2016 at 9:42

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-08 Thread Sam Tobin-Hochstadt
This library isn't part of the Racket distribution, so the release schedule doesn't really matter here. Sam On Fri, Jan 8, 2016 at 9:42 AM Robby Findler wrote: > We can do the simpler thing for this release, tho. And changing TR > won't happen for months. The simple suggestion is an easy, immed

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-08 Thread Sam Tobin-Hochstadt
My suggestion did involve changing TR. I think your suggestion was to change the trie library, which doesn't have to worry about the Racket release schedule. Sam On Fri, Jan 8, 2016 at 9:48 AM, Robby Findler wrote: > I thought your suggestion involved a change to TR. > > But whatever. Do what yo

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-08 Thread Robby Findler
We can do the simpler thing for this release, tho. And changing TR won't happen for months. The simple suggestion is an easy, immediate fix, and it will also give us goalposts to shoot for. Robby On Fri, Jan 8, 2016 at 8:19 AM, Sam Tobin-Hochstadt wrote: > I think a better solution is just to ad

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-08 Thread Sam Tobin-Hochstadt
I think a better solution is just to add immutable hash tables to TR, and then use them in the trie modules. That would allow TR to generate exactly the contracts that we could write by hand. Sam On Fri, Jan 8, 2016 at 9:06 AM, Robby Findler wrote: > We know there is a much more efficient set of

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-08 Thread Robby Findler
We know there is a much more efficient set of contracts than what TR generates right? How about an unsafe export of TR functions to a wrapper module that implements the safe checks by hand (by macro?)? Maybe that exercise will even feed back into an improvement to TR? Robby On Tuesday, January 5,

Re: [racket-users] Cycle in loading. Units, (sub)modules, files...

2016-01-08 Thread Daniel Feltey
This doesn't quite answer your question, but another possibility that would allow you to separate the a@ and b@ unit implementations in separate files is to put all of your signature definitions in a single file that will be required by both "a.rkt" and "b.rkt". In my experience, this strategy is f

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-08 Thread Asumu Takikawa
On 2016-01-05 14:39:17 -0500, 'John Clements' via Racket Users wrote: > Asumu, does this make sense to you? Note that in particular, I think that a > warning at the top of the pfds package wouldn’t have helped me; I think a > warning at the top of each pfds page would make a lot more sense. I'd be