[racket] syntax-temporaries srfi-53

2013-09-25 Thread Niitsuma Hirotaka
I am struggling with use unique name variable within srfi-53 (require (planet dvanhorn/srfi-53:1:0/srfi-53)) (syntax-inspect (syntax-temporaries (x y z))) ;==> (temp~1 temp~2 temp~3) > '(temp temp temp) All unique name are same: temp How to use unique name variable within srfi-53 ? __

Re: [racket] How write regexp for lexer

2013-09-25 Thread Evgeny Odegov
> I want to different two kind types of comment - first - is comment which > begin from start line (first symbol of line is '/' or whitespaces and '/' > ), second - is comment which start with '/' but beffore was reading any > other symbol (except whitespaces) > Javascript regexp for it is "^//.*\n

Re: [racket] Null value in macros

2013-09-25 Thread Diego Sevilla Ruiz
Hi! On 23/09/13 17:59, Matthias Felleisen wrote: Is the following code really that much more complicated that define-macro? -- Matthias Well, it certainly might not! But I don't find confident enough with syntax-case (less with syntax-parse), and I also have some code I will reuse that use

Re: [racket] Introduction to syntax-parse

2013-09-25 Thread Greg Hendershott
Without actually `require`-ing syntax-parse, could syntax-rules and syntax-case simply report this one special case differently? If the specific not-expression is the exact syntax `_`, then report not-an-expression (as usual) but also add the p.s. "Are you trying to use syntax-parse? " Maybe

[racket] RacketCon 2013 - attending: a new student (didn't say young), taking Coursera class on BSL/DrRacket (Univ. Brit. Columbia)

2013-09-25 Thread William Reilly
Hello from a new (not young) beginner -- I'm planning to attend RacketCon [1], and am currently working on the Coursera class offering [2] from the University of British Columbia (UBC) by Prof. Gregor Kiczales: Introduction to Systematic Program Design - Part 1, which uses the BSL in DrRacket. We

Re: [racket] consulting and open source Racket enhancements

2013-09-25 Thread Neil Van Dyke
Lawrence Woodman wrote at 09/25/2013 01:50 AM: On 24/09/13 23:28, Neil Van Dyke wrote: Anyway, I'm thinking of starting a side business of developing general-purpose Racket packages on demand -- modules that satisfy all clients' requirements and are incidentally open-sourced. Perhaps with some

Re: [racket] Macros: dealing with optional elements

2013-09-25 Thread Konrad Hinsen
Laurent writes: > Unsyntax-splicing to the rescue! Great, this evokes memories of Common Lisp macros... More importantly, it works! J. Ian Johnson writes: > This is such a common pattern that there is support for it with a > feature called syntax templates, in > syntax/parse/experimental/te

Re: [racket] use of SRFIs in Racket

2013-09-25 Thread David Vanderson
On 09/25/2013 12:01 AM, Edward Earnest wrote: Good evening all, This might be a silly question -- but what is the official status of the included SRFIs in Racket as they relate to #lang racket? I am working on my first Racket program and I need to be able to test if a given string is present

Re: [racket] How to get a shared environment in different modules in compile time

2013-09-25 Thread Sam Tobin-Hochstadt
This is, in part, the essence of the technique, so you're already on the right track. Sam On Wed, Sep 25, 2013 at 9:55 AM, Dmitry Pavlov wrote: > Sam, > > Thank you for the references. I will read them shortly. > For now, I got away with a macro-generating macro: > > > (define-syntax (def-with-c

Re: [racket] How to get a shared environment in different modules in compile time

2013-09-25 Thread Dmitry Pavlov
Sam, Thank you for the references. I will read them shortly. For now, I got away with a macro-generating macro: (define-syntax (def-with-comment stx) (syntax-case stx () ((_ (name comment . params) . body) #'(begin (begin-for-syntax (hash-set! comments (syntax->dat

Re: [racket] (sqlite3-connect) does not survive "raco distribute" on Windows, saying "sqlite3_open: implementation not found"

2013-09-25 Thread Dmitry Pavlov
Ryan, After some short research, I figured that the following small patch will fix the issue: diff --git a/ffi.rkt.bk b/ffi.rkt index c94aefb..1f610fb 100644 --- a/ffi.rkt.bk +++ b/ffi.rkt @@ -7,17 +7,17 @@ (provide (all-from-out "ffi-constants.rkt") (protect-out (all-defined-out)))

Re: [racket] use of SRFIs in Racket

2013-09-25 Thread Jay McCarthy
The SRFI ship with Racket and when they provide useful functionality not duplicated in the rest of Racket, I don't see any reason why you wouldn't want to use them, which is why they are shipped and indexed in the documentation. (Situations where they duplicate are stuff like promises and the itera

Re: [racket] How to get a shared environment in different modules in compile time

2013-09-25 Thread Sam Tobin-Hochstadt
On Wed, Sep 25, 2013 at 6:59 AM, Dmitry Pavlov wrote: > > However, I do not see how to fix that. Does anybody? > What is the recommended way to do that sort of thing in Racket? This turns out to be a subtle issue, but one we've thought a lot about. The best way to learn about how we do this in R

Re: [racket] Introduction to syntax-parse

2013-09-25 Thread Sam Tobin-Hochstadt
On Wed, Sep 25, 2013 at 2:14 AM, Konrad Hinsen wrote: > > > Maybe making the error message more specific like "Did you forget to > (require > > (for-syntax syntax/parse)) ?" ? Or is it too specific? > > It would already help a lot if the error message said something about > syntax-parse being u

Re: [racket] How write regexp for lexer

2013-09-25 Thread Бомбин Валентин
Thansk for answer, but it can't help. Simple example latter - #lang racket/base (require racket/string parser-tools/lex (prefix-in : parser-tools/lex-sre)) (define-tokens my-tokens (BCOMMENT COMMENT OT)) (define-empty-tokens my-empty-tokens (EOF NEWLINE)) (define-lex-abbre

Re: [racket] How write regexp for lexer

2013-09-25 Thread Evgeny Odegov
Валентин, maybe this short example could help http://pastebin.com/ncZpH49E > > Hello. I need write rule for lexer for recognize comment which begin from > first column of line. > I have next regexp for comment (:seq "//" (:* (:~ CR LF))), aftrer add > cr/lf to begin of expression i write (:seq L

[racket] How to get a shared environment in different modules in compile time

2013-09-25 Thread Dmitry Pavlov
Hello, Suppose I am trying to have my own variant of (define), which tags text comments to things that it defines. I am keeping the comments in a hashtable for whatever purpose, and in the following example I am just printing them to the standard output: ~ defcom.rkt #lang racket (define-fo

Re: [racket] Macros: dealing with optional elements

2013-09-25 Thread J. Ian Johnson
This is such a common pattern that there is support for it with a feature called syntax templates, in syntax/parse/experimental/template. You would use (?? super) to add super only if it's given, and nothing otherwise. -Ian - Original Message - From: Laurent To: Konrad Hinsen Cc: users

Re: [racket] Lack of understanding of how module loading work with (for-syntax)

2013-09-25 Thread Dmitry Pavlov
Ryan, Thank you, your explanation about DrRacket's debugging and "raco make" has really made sense to me. Also, it helped me to figure my original problem in more specific terms; I will do a separate post about it. Regards, Dmitry On 09/25/2013 09:52 AM, Ryan Culpepper wrote: Are you running

Re: [racket] Macros: dealing with optional elements

2013-09-25 Thread Laurent
On Wed, Sep 25, 2013 at 11:31 AM, Konrad Hinsen wrote: > >(define-syntax (foo stx) > (syntax-parse stx >[(_ id:id (~optional super:id) (field:id ...)) > (if (attribute super) > #'(struct id super (field ...)) >

[racket] Macros: dealing with optional elements

2013-09-25 Thread Konrad Hinsen
Hi everyone, I am struggling with what looks like a straightforward macro issue, but even after reading most of the documentation three times, I am stuck. I want to write a macro that behaves much like struct and produces a struct form. In particular, it should accept the struct name followed by

[racket] How write regexp for lexer

2013-09-25 Thread Бомбин Валентин
Hello. I need write rule for lexer for recognize comment which begin from first column of line. I have next regexp for comment (:seq "//" (:* (:~ CR LF))), aftrer add cr/lf to begin of expression i write (:seq LineTerminator (:* (:or #\space TAB FF)) "//" (:* (:~ CR LF))), but this regexp -fi