Re: [racket] Racket newbie questions

2013-05-05 Thread Ryan Culpepper
On 05/05/2013 10:45 PM, John Gateley wrote: Lots of newbie questions: 1) If I am creating a new class that has a "size" field, what is the convention for naming the initialization argument? "size" doesn't work! This name must be known by all class creators. (class object % (init init-size) ;;

Re: [racket] Racket newbie questions

2013-05-05 Thread Asumu Takikawa
Here're some answers to a subset of your questions: On 2013-05-05 21:45:20 -0500, John Gateley wrote: > 1) If I am creating a new class that has a "size" field, what is the > convention for naming the initialization argument? "size" doesn't > work! This name must be known by all class creators. >

[racket] Racket newbie questions

2013-05-05 Thread John Gateley
Lots of newbie questions: 1) If I am creating a new class that has a "size" field, what is the convention for naming the initialization argument? "size" doesn't work! This name must be known by all class creators. (class object % (init init-size) ;; init-size cannot be size (define size init-

Re: [racket] making postgresql timestamp

2013-05-05 Thread Ryan Culpepper
It looks like postgres is expecting an integer instead of a timestamp for that query parameter. Are you sure the corresponding field is declared as a timestamp? Make sure you've written things in the right order. Ryan On 05/05/2013 09:39 PM, Kejia柯嘉 wrote: Hi Ryan, Thanks a lot for your repl

Re: [racket] making postgresql timestamp

2013-05-05 Thread Kejia柯嘉
Hi Ryan, Thanks a lot for your reply. How should I `insert into' a timestamp field in postgres? When I apply a sql-timestamp to query-exec, I got exceptions: `` query-exec: cannot convert given value to SQL type given: (sql-timestamp 2013 5 5 21 56 22 48000 #f) type: int2 expected: int1

Re: [racket] making postgresql timestamp

2013-05-05 Thread Ryan Culpepper
On 05/04/2013 01:22 PM, Kejia柯嘉 wrote: Hi, How should I construct a postgresql timestamp in terms of current time? Thanks. On the Racket side: (require db db/util/datetime (prefix-in srfi: srfi/19)) (srfi-date->sql-timestamp-tz (srfi:current-date)) On the server side: (define c (post

Re: [racket] syntax-parse and matching ordered optional keyworded expressions

2013-05-05 Thread Eric Dobson
Version 1 was what I meant by not duplicating work, and version 2 seems much too complicated. It looks like syntax/parse/experimental/eh, does what I need. On Sun, May 5, 2013 at 1:11 PM, J. Ian Johnson wrote: > One way is to have your ~or form in an ~and with a catch-all where you can > observ

Re: [racket] syntax-parse and matching ordered optional keyworded expressions

2013-05-05 Thread J. Ian Johnson
One way is to have your ~or form in an ~and with a catch-all where you can observe the ordering. That is, (~and (~seq forms ...) (~seq (~or (~optional (~seq #:kw0 kw0)) ...others...) ...)) Then walk through (forms ...) when you're outputting your changed keyword arguments to determine which to o

[racket] syntax-parse and matching ordered optional keyworded expressions

2013-05-05 Thread Eric Dobson
I'm trying to improve the struct: form in TR, and one of the things I need to do is match a sequence of keyworded expressions, add annotations on the expressions, and then put them back into the same order. I can either do a large ~or clause and have optional constraints on each clause, but If I d

Re: [racket] Planet2 questions

2013-05-05 Thread Walter Tetzner
> In the context of packages, does it make sense to refer to a package > name without a major version number, given that major versions are > incompatible? > > I think the reasons we have to refer to package names would all require > a major version, and so I agree with the way the current design s

Re: [racket] Planet2 questions

2013-05-05 Thread Matthew Flatt
At Thu, 2 May 2013 10:20:09 -0400, Walter Tetzner wrote: > On Tue, Apr 30, 2013 at 12:24 PM, Matthew Flatt wrote: > > 2. It could mean that the package system has a built-in way to declare > > dependencies not only on a particular package, but on a particular > > revision of a package ---

[racket] Explicitly rerouting web-server requests to filesystem server

2013-05-05 Thread Matthew Butterick
The docs for web-server/dispatch allude to the filesystem server that lurks behind the dispatch rules to handle requests that are not handled by dispatch rules. Is there a way to explicitly send a request to the filesystem server? For instance, I have a dispatch route that checks if the requested