Re: [racket-dev] can a syntax-class inherit attributes?
Ah, thanks. That's exactly what I wanted. How stable are these features? Shall I add them to the docs? On Fri, Aug 23, 2013 at 12:54 AM, Carl Eastlund c...@ccs.neu.edu wrote: Here's how you want to define AorB: (define-syntax-class AorB #:auto-nested-attributes (pattern :A) (pattern :B)) There's two things going on here, both of which I believe are undocumented, sadly. One is #:auto-nested-attributes, an option that tells AorB that anything bound as an attribute by nested sub-patterns in its clauses should automatically become an attribute of AorB. The other is that empty identifier does not add . to its attribute names. When you bind a with the attribute X, you get A.X, and when you bind b, you get b.X, but when you bind the empty identifier, you just get X. So now you just have X bound in both clauses, and that's automatically made an attribute of AorB, and it all works like you want. Carl Eastlund On Fri, Aug 23, 2013 at 12:22 AM, Stephen Chang stch...@ccs.neu.edu wrote: Is there a way for a syntax-class to automatically inherit attributes? For example, the third class below combines the first two. Is there a way to automatically get the attributes from the first two classes in the third one (ie, I want to drop the #:attr X #'a.X part in the third class)? #lang racket (require syntax/parse) (define-syntax-class A (pattern (a b) #:attr X #'b)) (define-syntax-class B (pattern (a b c) #:attr X #'c)) (define-syntax-class AorB (pattern a:A #:attr X #'a.X) (pattern b:B #:attr X #'b.X)) (syntax-parse #'(list 1) [ab:AorB (attribute ab.X)]) _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] can a syntax-class inherit attributes?
You'd have to ask Ryan to be sure, but I think they're pretty stable. I've been using them for some time. Carl Eastlund On Fri, Aug 23, 2013 at 12:53 PM, Stephen Chang stch...@ccs.neu.edu wrote: Ah, thanks. That's exactly what I wanted. How stable are these features? Shall I add them to the docs? On Fri, Aug 23, 2013 at 12:54 AM, Carl Eastlund c...@ccs.neu.edu wrote: Here's how you want to define AorB: (define-syntax-class AorB #:auto-nested-attributes (pattern :A) (pattern :B)) There's two things going on here, both of which I believe are undocumented, sadly. One is #:auto-nested-attributes, an option that tells AorB that anything bound as an attribute by nested sub-patterns in its clauses should automatically become an attribute of AorB. The other is that empty identifier does not add . to its attribute names. When you bind a with the attribute X, you get A.X, and when you bind b, you get b.X, but when you bind the empty identifier, you just get X. So now you just have X bound in both clauses, and that's automatically made an attribute of AorB, and it all works like you want. Carl Eastlund On Fri, Aug 23, 2013 at 12:22 AM, Stephen Chang stch...@ccs.neu.edu wrote: Is there a way for a syntax-class to automatically inherit attributes? For example, the third class below combines the first two. Is there a way to automatically get the attributes from the first two classes in the third one (ie, I want to drop the #:attr X #'a.X part in the third class)? #lang racket (require syntax/parse) (define-syntax-class A (pattern (a b) #:attr X #'b)) (define-syntax-class B (pattern (a b c) #:attr X #'c)) (define-syntax-class AorB (pattern a:A #:attr X #'a.X) (pattern b:B #:attr X #'b.X)) (syntax-parse #'(list 1) [ab:AorB (attribute ab.X)]) _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] Fwd: Call for satellite events for TFP 2014 in the Netherlands (May 26-28, 2014)
In case anyone here is interested in running a TFP colocated event. David Original Message Subject: Call for satellite events for TFP 2014 in the Netherlands (May 26-28, 2014) Date: Fri, 23 Aug 2013 15:39:37 +0200 From: Jurriaan Hage j.h...@uu.nl Dear all, At this time, TFPIE is the only satellite event of TFP (chaired by James Caldwell of the University of Wyoming). However, in case any of you, or anyone you know of, is interested in organising an functional programming oriented event (such as workshops, symposia and project meetings) alongside TFP, I am also happy to accommodate this. An application should (at least) include the name and details of the contact person, the title and scope of the event, the length (like: a day, two, an afternoon), your preference for the date (if any), the expected number of participants, and details on how the event will be financed. Upon request I can provide some further details on how much things cost, but as you can imagine they vary greatly with the needs of the event. Closing time for application (directly by e-mail to me) is October 1. Notification of acceptance will be before October 8. best regards, Jur The TFP website is still http://www.cs.uu.nl/wiki/bin/view/TFP2014/WebHome It also includes the above information. PS. Feel free to communicate this information to anyone you think might be interested. _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] net/http-client
Based on a request back in early July to remove the restrictions that net/url puts on HTTP communication (vis a vis URL encoding), I have just pushed a new HTTP client as net/http-client. The push also changes net/url to use net/http-client so that we just have 1 HTTP request producer, rather than 3. It passes all of the net/* tests, but these don't use features like proxying, HTTP/1.1, etc. I'm slightly nervous that it doesn't do those correct, but not super nervous, because I just cut-and-pasted the code. The main approach of the library is best explained by this contract: [http-sendrecv (-* ((or/c bytes? string?) (or/c bytes? string?)) (#:ssl? (or/c boolean? ssl-client-context? symbol?) #:port (between/c 1 65535) #:method (or/c bytes? string? symbol?) #:headers (listof (or/c bytes? string?)) #:data (or/c false/c bytes? string?)) (values bytes? (listof bytes?) input-port?))] Compared to net/url, - It supports bytes and strings everywhere - It supports data on every method and not just POST - It always returns the status line, headers, and content (as a port) I feel that the only thing it could do better is support two more options for #:data: - A input-port? to read from and copy to the HTTP connection - A (- output-port? void) function to call with the HTTP connection's output port to stream the data But I'd like a second opinion before adding them. Jay -- Jay McCarthy j...@cs.byu.edu Assistant Professor / Brigham Young University http://faculty.cs.byu.edu/~jay The glory of God is Intelligence - DC 93 _ Racket Developers list: http://lists.racket-lang.org/dev