Re: [racket] selectively local-expand sub-expressions

2014-01-26 Thread Scott Klarenbach
asking, at least not based > on the example you wrote. You defined x and y, but the error is about z. > Is this just a typo? Or are you expecting a value for z to come from > somewhere? > > Carl Eastlund > > > On Sun, Jan 26, 2014 at 1:01 PM, Scott Klarenbach wrote: >

Re: [racket] selectively local-expand sub-expressions

2014-01-26 Thread Scott Klarenbach
ed?", for example. > I don't know if that's a concern, but again, it can't hurt. Anyway, you > can find what I wrote here: https://gist.github.com/carl-eastlund/8626893 > > Carl Eastlund > > On Fri, Jan 24, 2014 at 1:30 PM, Scott Klarenbach wrote: > >>

Re: [racket] selectively local-expand sub-expressions

2014-01-24 Thread Scott Klarenbach
l))) 'expression #f)] Thanks. -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca 200-1575 W. Georgia Vancouver, BC V6G2V3 ___ To iterate is human; to recur, divine Racket Users list: http://lists.racket-lang.org/users

Re: [racket] selectively local-expand sub-expressions

2014-01-23 Thread Scott Klarenbach
like > match patterns that have a wholly different meaning. > > There's a reason local-expand is as limited as it is. Macro expansion is > very hard to do inside anything except a fully expanded context. Usually > when we want to control expansion somewhere else, we either local ex

[racket] selectively local-expand sub-expressions

2014-01-23 Thread Scott Klarenbach
the inner procedures I wish by applying local-expand to the nested operands. My question is: 1.) Is there a simple library way to do this with local-expand that I'm missing? 2.) Does anyone have a hint or code example to do this manually using recursion? It should be simple en

Re: [racket] Structs and syntax-local-value ... how is the struct name overloaded? (Greg Hendershott)

2014-01-20 Thread Scott Klarenbach
exts you have no > control over. > > Carl Eastlund > > > On Mon, Jan 20, 2014 at 6:31 PM, Scott Klarenbach wrote: > >> If/when it does matter, instead you could use a hashtable on the side, >>> mapping from the procedure to the info. Of course that way, you need >>

Re: [racket] Structs and syntax-local-value ... how is the struct name overloaded? (Greg Hendershott)

2014-01-20 Thread Scott Klarenbach
-------- > > Message: 1 > Date: Mon, 20 Jan 2014 13:00:35 -0500 > From: Carl Eastlund > To: "Alexander D. Knauth" > Cc: Scott Klarenbach , Racket mailing list > > Subject: Re: [racket] Structs and

Re: [racket] Structs and syntax-local-value ... how is the struct name overloaded?

2014-01-19 Thread Scott Klarenbach
acro (illegal syntax), or have (define-syntax (posn) #'something), and then (syntax-local-value #'posn) returns the transformer, rather than 'something. On Sun, Jan 19, 2014 at 8:57 PM, Scott Klarenbach wrote: > It's not changing it, I'm just trying to figure out the

Re: [racket] Structs and syntax-local-value ... how is the struct name overloaded?

2014-01-19 Thread Scott Klarenbach
ething out via syntax-local-value that > doesn't? > > Carl Eastlund > > On Sun, Jan 19, 2014 at 11:27 PM, Scott Klarenbach wrote: > >> But I don't see how the same binding can be a transformer and also return >> something else (like a list, or a checked-struct

Re: [racket] Structs and syntax-local-value ... how is the struct name overloaded?

2014-01-19 Thread Scott Klarenbach
wondering how the overloading works. Is it some clever >> use of prop:procedure? >> >> Thanks. >> >> -- >> Talk to you soon, >> >> Scott Klarenbach >> >> PointyHat Software Corp. >> www.pointyhat.ca >> p 604-568-4280 >&g

[racket] Structs and syntax-local-value ... how is the struct name overloaded?

2014-01-19 Thread Scott Klarenbach
hidden meta-data under the same binding to other macros that might wish to know about the binding at compile time? I'm specifically wondering how the overloading works. Is it some clever use of prop:procedure? Thanks. -- Talk to you soon, Scott Klarenbach PointyHat Software

Re: [racket] at-exp with module language

2014-01-13 Thread Scott Klarenbach
key ingredient? On Mon, Jan 13, 2014 at 1:45 PM, Eli Barzilay wrote: > Yesterday, Scott Klarenbach wrote: > > > > I assumed that #lang at-exp "my-lang.rkt" should work, since I'm > > wanting to use at-exp syntax with "my-lang.rkt" semantics. I&#

Re: [racket] at-exp with module language

2014-01-12 Thread Scott Klarenbach
to implement my own reader that internally uses at-exp 's read-syntax and read functions? Thanks. On Thu, Jan 9, 2014 at 6:57 PM, Matthew Flatt wrote: > You're right that `at-exp` isn't like `s-exp`, but you can use > > #lang at-exp s-exp "my-lang.rkt" >

Re: [racket] How to provide module bindings required with for-doc

2014-01-12 Thread Scott Klarenbach
vide (for-doc ...))`, so far. I don't yet know how to > make it work, but the problem is at least on my radar. > > At Fri, 10 Jan 2014 17:43:03 -0800, Scott Klarenbach wrote: > > How can one file provide the bindings it required using the for-doc > subform > > to other modu

[racket] How to provide module bindings required with for-doc

2014-01-10 Thread Scott Klarenbach
a bit foggy on the details. Thanks. -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca 200-1575 W. Georgia Vancouver, BC V6G2V3 ___ To iterate is human; to recur, divine

[racket] at-exp with module language

2014-01-09 Thread Scott Klarenbach
g reader file ie, my-lang/lang/reader.rkt? Is there a shortcut to what I'm trying to do that doesn't involve overriding read and read-syntax? Either that or I might just have a simple mistake in my-lang.rkt file. Thanks. -- Talk to you soon, Scott Klarenbach PointyHat Software Co

Re: [racket] module+ test... (require rackunit) results in unbound identifier when used in macro

2014-01-08 Thread Scott Klarenbach
. > > Carl Eastlund > > > On Wed, Jan 8, 2014 at 7:13 PM, Scott Klarenbach wrote: > >> Sorry, gmail sent before I could paste :( >> >> ... >> >> So I changed the macro definition to: >> >> (define-syntax (define/spec stx) >> (syn

Re: [racket] module+ test... (require rackunit) results in unbound identifier when used in macro

2014-01-08 Thread Scott Klarenbach
..])) Notice the extra (require rackunit), after the modified (require ru-require). Is that the right solution? On Wed, Jan 8, 2014 at 4:00 PM, Carl Eastlund wrote: > On Wed, Jan 8, 2014 at 6:44 PM, Scott Klarenbach wrote: > >> Thanks guys. >> >> I changed it to thi

Re: [racket] module+ test... (require rackunit) results in unbound identifier when used in macro

2014-01-08 Thread Scott Klarenbach
) body ...) (module+ test (require ru-require) (test-case id-str test-body ...])) On Wed, Jan 8, 2014 at 4:00 PM, Carl Eastlund wrote: > On Wed, Jan 8, 2014 at 6:44 PM, Scott Klarenbach wrote: > >> Thanks guys. >> >> I changed it to this: >> >> (de

Re: [racket] module+ test... (require rackunit) results in unbound identifier when used in macro

2014-01-08 Thread Scott Klarenbach
;> (require rackunit) >> (test-case id-str >> new-test-body ...])) >> >> (define/test (my-fn a b c) >> (print a) >> (print b) >> (print c) >> #:test >> (check-true #t)

[racket] module+ test... (require rackunit) results in unbound identifier when used in macro

2014-01-08 Thread Scott Klarenbach
missing? Thanks. -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca 200-1575 W. Georgia Vancouver, BC V6G2V3 ___ To iterate is human; to recur, divine Racket Us

Re: [racket] Macros With Multiple Ellipsis

2014-01-08 Thread Scott Klarenbach
) > (print 'test2)) > (define-values (x y z) (values 10 20 30)) > (my-fn x y z) > > => 102030'test1'test2 > > On Wed, Jan 8, 2014 at 2:58 PM, Scott Klarenbach > wrote: > > I have a macro that modifies define to perform some additional > processing. >

[racket] Macros With Multiple Ellipsis

2014-01-08 Thread Scott Klarenbach
ing a simple mistake? Or am I resigned to manually parsing out the single test-expr into multiple forms in the template? Thanks. -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca 200-1575 W. Georgia Vancouver, BC V6G2V3

Re: [racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-29 Thread Scott Klarenbach
posted, most likely via random SOS pings to this list :). Thanks. On Sun, Dec 29, 2013 at 10:16 AM, Matthias Felleisen wrote: > > On Dec 28, 2013, at 2:01 PM, Scott Klarenbach wrote: > > I'm playing around with the idea of a sort of "Language Integrated Query" > lik

Re: [racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-29 Thread Scott Klarenbach
ket-mode/blob/master/defn.rkt I'll look into that code of yours. On Sun, Dec 29, 2013 at 7:32 AM, Greg Hendershott wrote: > On Sat, Dec 28, 2013 at 2:01 PM, Scott Klarenbach > wrote: > > It would be really nice to print the source code of a known procedure on > the > >

Re: [racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-28 Thread Scott Klarenbach
n. > It would be really nice to print the source code of a known procedure on the repl, in order to get a quick view of what it does. Or, the "pa" function which prints out the arguments of a procedure is even more useful. On Fri, Dec 27, 2013 at 4:35 PM, Matthias Felleisen wrote: &g

[racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-27 Thread Scott Klarenbach
tion involves some type of beta reduction and/or argument constraints, but I'm just looking for a nudge in the right direction. Thanks. -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca 200-1575 W. Georgia Vancouver, BC V6G2V

Re: [racket] Expander vs Reader layer and general Macro advice

2013-09-10 Thread Scott Klarenbach
at 6:09 AM, Jay McCarthy wrote: > On Mon, Sep 9, 2013 at 2:39 PM, Scott Klarenbach wrote: > >> @Jay >> >> I'm not sure what you mean by "Doing a regex-match loses the original >>> typing information" >> >> >> I just meant that si

Re: [racket] Expander vs Reader layer and general Macro advice

2013-09-09 Thread Scott Klarenbach
t;syntax #'sym > (string->identifier-symbol-string-or-number ns))) (regexp-split #rx":" > (symbol->string (syntax->datum #'sym))) > > Jay > > > > On Sun, Sep 8, 2013 at 1:29 PM, Scott Klarenbach wrote: > >> So in an attempt to improve my

[racket] Expander vs Reader layer and general Macro advice

2013-09-08 Thread Scott Klarenbach
und-identifier~3d~3f%29%29> stuff a bit, but my understanding is clearly lacking and before I go about reconstructing lexical information ad-hoc I thought I'd post this as a sanity check to point me in the right direction. Thanks for your help. -- Talk to you soon, Scott Klarenbach

Re: [racket] Canadian Racketeers

2013-09-06 Thread Scott Klarenbach
ntreal I'll be interested in meeting you. Also, I am the organizer of > the MSLUG (Montreal Scheme/Lisp User Group) and I want to extend an > invitation to come talk about your experience at a future meeting. > > Marc > > On 2013-09-06, at 3:29 PM, Scott Klarenbach wrote: > &

Re: [racket] Canadian Racketeers

2013-09-06 Thread Scott Klarenbach
t;>> invitation to come talk about your experience at a future meeting. >>> >>> Marc >>> >>> >>> On 2013-09-06, at 3:29 PM, Scott Klarenbach wrote: >>> >>> > Just wondering about a meetup for any interested Racketeers that ar

[racket] Canadian Racketeers

2013-09-06 Thread Scott Klarenbach
soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca 200-1575 W. Georgia Vancouver, BC V6G2V3 ___ To iterate is human; to recur, divine Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Immutable vectors

2013-09-04 Thread Scott Klarenbach
imensions > >> of a (functional image) canvas and created a gridded image and an event > >> handler that tells you on which "tile" a user clicked. It is highly > real, > >> higher-order, dependent, and yet not difficult to understand. > > > > > >

Re: [racket] users Digest, Vol 97, Issue 12

2013-09-04 Thread Scott Klarenbach
>> of a (functional image) canvas and created a gridded image and an event > >> handler that tells you on which "tile" a user clicked. It is highly > real, > >> higher-order, dependent, and yet not difficult to understand. > > > > > > Alas, I a

Re: [racket] Code Reuse, Object Oriented vs Functional

2013-06-21 Thread Scott Klarenbach
Thanks a lot for the responses. I really appreciate it. It's reassuring to hear many of my assumptions echoed back. And the mention of the Expression Problem has led me to uncover additional articles on the topic besides the original Krishnamurti, et al paper. Scott. Rack

[racket] Code Reuse, Object Oriented vs Functional

2013-06-20 Thread Scott Klarenbach
better suited to an object oriented design vs functional and vice-versa, or is the power of such languages as racket reducing the OO vs Functional debate to a religious war, whereby both methods achieve reuse and it's just a matter of preference? Thanks a lot. -- Talk to you soon, Scott Klare

Re: [racket] Macros, Eval and dynamic syntax?

2013-04-17 Thread Scott Klarenbach
Nevermind. I was making things way too complicated. Obviously I can just return #'(pattern) in the event I'd like the caller's procedure invoked. Thanks. On Wed, Apr 17, 2013 at 11:29 AM, Scott Klarenbach wrote: > Hi there, > > With my limited macro knowledge I&#x

[racket] Macros, Eval and dynamic syntax?

2013-04-17 Thread Scott Klarenbach
he macro so that the above would work? Thanks. -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca 200-1575 W. Georgia Vancouver, BC V6G2V3 ___ To iterate is human; to recur, divine Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Using syntax/parse, how to accept keyword arguments in any order yet not allow duplicates?

2013-04-07 Thread Scott Klarenbach
range given in ~in-between, even in ellipsis'd contexts. > (a:id b:id (~or (~once (~seq #:key1 c:id)) (~once (~seq #:key2 d:id))) ...) > > -Ian > > - Original Message - > From: "Scott Klarenbach" > To: "Racket mailing list" > Sent: Sun

[racket] Using syntax/parse, how to accept keyword arguments in any order yet not allow duplicates?

2013-04-07 Thread Scott Klarenbach
y2 one #:key2 two #:key2 three) The reasons are obvious. I'm just wondering if there's a more robust way of dealing with these types of scenarios that I'm missing? I thought of combining an (~or (~and clause but that becomes very tedious, and leaves the duplicate problem uns

Re: [racket] Parameterize current-seconds?

2013-04-01 Thread Scott Klarenbach
ation that you own? > -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca 200-1575 W. Georgia Vancouver, BC V6G2V3 ___ To iterate is human; to recur, divine Racket U

Re: [racket] Parameterize current-seconds?

2013-04-01 Thread Scott Klarenbach
2013 at 2:40 PM, Danny Yoo wrote: > Hmmm. Thinking... can you parameterize the sha1-hash constructor > instead, since that's probably under your control? > -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca 200-1575 W.

Re: [racket] Parameterize current-seconds?

2013-04-01 Thread Scott Klarenbach
PM, Danny Yoo wrote: > Hmmm... I don't think so. Is there a application for which > parameterizing current-seconds is useful? > -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca 200-1575 W. Geor

[racket] Parameterize current-seconds?

2013-04-01 Thread Scott Klarenbach
e. Thanks. -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca 200-1575 W. Georgia Vancouver, BC V6G2V3 ___ To iterate is human; to recur, divine Racket Users list: http://li

Re: [racket] Macros with Flexible Sub-Forms like (class...)

2013-02-23 Thread Scott Klarenbach
Thanks Danny. There's also something I recall for validation, as in the docs for (define/override...) where usage outside of a (class...) form is a syntax error. I'll hunt...:) On Sat, Feb 23, 2013 at 12:19 PM, Danny Yoo wrote: > On Sat, Feb 23, 2013 at 12:22 PM, Scott Klaren

[racket] Macros with Flexible Sub-Forms like (class...)

2013-02-23 Thread Scott Klarenbach
f boiler plate and so I figured maybe I'm creating too much work for myself by attempting to do it all manually. Thanks a lot. -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca 200-1575 W. Georgia Vancouver, BC V6G2V

Re: [racket] Wildcard Macro Names?

2013-01-30 Thread Scott Klarenbach
-my-action), but would prefer the token to be self-contained as in (@x = 2) or ($do-something). Scott. On Sun, Jan 27, 2013 at 1:08 AM, Eli Barzilay wrote: > On Wednesday, Scott Klarenbach wrote: > > Is it possible to have a macro bound to an identifier with wildcards > > in it? > >

[racket] Wildcard Macro Names?

2013-01-23 Thread Scott Klarenbach
, and the reader turns @x and @y into (@ x) and (@ y) respectively. Thanks. -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca #308 - 55 Water St. Vancouver, BC V6B1A1 ___ To iterate is human

[racket] Web server dispatch-rules! bug?

2013-01-16 Thread Scott Klarenbach
ting the #:method param works fine in the second example. Thanks. -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca #308 - 55 Water St. Vancouver, BC V6B1A1 ___ To iterate is human;

[racket] Status of Moby?

2013-01-12 Thread Scott Klarenbach
Hi, I was wondering about current status of Moby. Is it still active? How stable? What is and is not yet supported? Thanks. -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca #308 - 55 Water St. Vancouver, BC V6B1A1

Re: [racket] json module bug?

2012-12-04 Thread Scott Klarenbach
My bad, thanks! On Tue, Dec 4, 2012 at 12:24 PM, Danny Yoo wrote: > > > On Tue, Dec 4, 2012 at 12:21 PM, Scott Klarenbach wrote: > >> Is this a bug with the json module, or am I missing something about the >> implementation? >> >> It seems it crashes w

[racket] json module bug?

2012-12-04 Thread Scott Klarenbach
ected argument of type BUT this works: >> (jsexpr->string (hash 'id 1 'title "core")) "{\"id\":1,\"title\":\"core\"}" -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointy

[racket] Racket vs Scheme, macros and new syntax

2012-11-05 Thread Scott Klarenbach
rs to this end, or does it more fundamentally extend Scheme to do things technically *impossible *in that language? Thanks a lot. -- Talk to you soon, Scott Klarenbach PointyHat Software Corp. www.pointyhat.ca p 604-568-4280 e sc...@pointyhat.ca #308 - 55 Water St. Vancouver, BC V