[racket-users] "Contracts can have significant overhead" but Typed Racket cannot?

2016-02-29 Thread Nota Poin
I'm not sure what the qualitative distinction is between contracts and Typed Racket. They seem like two syntaxes for what mostly amount to the same thing. Is it just a matter of implementation, or perhaps what their developers focus on? You could in theory read through a list of contracts, and o

Re: [racket-users] Re: how to transform syntax post-expansion?

2016-02-15 Thread Nota Poin
On Monday, February 15, 2016 at 5:43:38 PM UTC, Ryan Culpepper wrote: > The macro should use `local-expand` rather than `expand`. See the docs > for `local-expand`, since it takes more arguments. I would guess you > probably want to pass along `(syntax-local-context)` and use an empty > stop lis

Re: [racket-users] (eqv? Racket-land Wonderland) -> #t

2016-02-15 Thread Nota Poin
On Monday, February 15, 2016 at 8:50:31 PM UTC, Matthew Butterick wrote: > https://en.wikipedia.org/wiki/Blue_Flame_(automobile) Oh, that's beautiful. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop recei

Re: [racket-users] Re: (eqv? Racket-land Wonderland) -> #t

2016-02-15 Thread Nota Poin
On Monday, February 15, 2016 at 3:29:23 PM UTC, Neil Van Dyke wrote: > Nota Poin wrote on 02/15/2016 05:40 AM: > You seem to be itemizing complaints that come to your mind, Sorry, I shouldn't have been complaining. > but I don't > see how all of them are responding to t

[racket-users] Re: (eqv? Racket-land Wonderland) -> #t

2016-02-15 Thread Nota Poin
On Saturday, February 13, 2016 at 5:35:09 PM UTC, Saša Janiška wrote: > So, at the end I just wonder how is it that such Wonderland is not > discovered by much more people? Startup is slow. Intractable problem, JIT compiling just takes time, and can't be cached beforehand. Like with pypy vs cpyth

[racket-users] Re: how to transform syntax post-expansion?

2016-02-14 Thread Nota Poin
On Monday, February 15, 2016 at 4:07:53 AM UTC, Nota Poin wrote: > (define-syntax (transform-post-expansion stx) > (syntax-case (expand stx) () > (...))) Right, expand the syntax to expand the syntax... that'll work out great... -- You received this message because you are

[racket-users] Re: how to transform syntax post-expansion?

2016-02-14 Thread Nota Poin
I suppose I could do something like this: (define-syntax (transform-post-expansion stx) (syntax-case (expand stx) () (...))) -- 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,

[racket-users] how to transform syntax post-expansion?

2016-02-14 Thread Nota Poin
I was trying to transform the syntax produced by an (include/...) statement, specifically (include/text) from scribble/text. But when I did this: (transform (include "somefile.scribble")) it transformed the syntax #'(include "somefile.scribble"), not the syntax produced from its expansion. I'm r

Re: [racket-users] splicing conditional results in the surrounding block?

2016-02-12 Thread Nota Poin
On Friday, February 12, 2016 at 1:26:05 AM UTC, Matthew Butterick wrote: > Of course, you can also use the `at-exp` metalanguage from Scribble to > simplify text-heavy constructions like these, with variables interpolated > into strings: > #lang at-exp racket > > (define (query condA condB (lim

Re: [racket-users] splicing conditional results in the surrounding block?

2016-02-12 Thread Nota Poin
On Thursday, February 11, 2016 at 12:29:04 PM UTC, Neil Van Dyke wrote: > http://www.neilvandyke.org/racket-html-template/ This does almost exactly what I was thinking about! Looking at the code makes me go cross-eyed, but if you (expand-once #'(html-template ...)) enough, it turns the SXML tree

[racket-users] Re: splicing conditional results in the surrounding block?

2016-02-11 Thread Nota Poin
okay, I got it I think. (begin-for-syntax (define/contract (quotify stx) (-> (syntax/c (listof any/c)) (listof syntax?)) (map (λ (stx) (syntax-case stx () (e #'(quote e (syntax->list stx))) (define/contract (splice-tf stx) (-> syntax? syntax?) (

Re: [racket-users] splicing conditional results in the surrounding block?

2016-02-11 Thread Nota Poin
On Thursday, February 11, 2016 at 9:08:33 AM UTC-8, Matthew Butterick wrote: > I'm supposing you know that Racket has at least two native representations > (X-expression and SXML) for HTML-like structures, so hacking HTML tags by > hand is unnecessary. Yes, thank you for mentioning them. I was

[racket-users] Re: splicing conditional results in the surrounding block?

2016-02-11 Thread Nota Poin
I guess this transformation is what I'm looking for: (transform (list stuff ... (if test (list yes ...) (list no ...)) more ...)) => (if test (transform (list stuff ... yes ... more ...)) (transform (list stuff ... no ... more ...))) but of course you can't

[racket-users] splicing conditional results in the surrounding block?

2016-02-11 Thread Nota Poin
I run into this problem a lot whenever I'm generating some text. I'll be making what amounts to a sequence of strings being appended, and do something like this: (apply string-append (list "" something "")) Compared to un-parsing a representation of a document tree every single time, simpli

[racket-users] send-generic vs send

2015-12-01 Thread Nota Poin
I don't really get what generics are. What is the difference between this: (define show (generic window<%> show)) (send-generic a-window show #t) and this: (send a-window show #t) If the former re...uses the (generic window<%> show) method to be "more" efficient, then why isn't show already a

Re: [racket-users] cannot produce units from syntax transformers

2015-11-28 Thread Nota Poin
On Saturday, November 28, 2015 at 11:24:28 PM UTC, Matthew Flatt wrote: > That is, `import` is a binding form, just like `let`. Oh, that makes sense. So it gets swapped in the macro for a hygenic named variable, and the ones I pass by that name don't get swapped in the same fashion, thus aren't

[racket-users] cannot produce units from syntax transformers

2015-11-28 Thread Nota Poin
I'm not sure why, but this works: (unit (import foo^) (export bar^) (+ foo bar))) while this fails: (define-syntax-rule (asyn body ...) (unit (import foo^) (export bar^) body ...)) (asyn (+ foo bar)) with the error "unit: undefined export" for any imported variables. Someh

Re: [racket-users] Re: racket users fight for their right to colon keywords

2015-11-08 Thread Nota Poin
On Monday, November 9, 2015 at 3:17:59 AM UTC, Neil Van Dyke wrote: > Note that, unlike some languages, I *don't* want `x` and `y` to be > optionally positional -- only keyworded. In my opinion, supplying a default value should make an argument implicitly keywordable. So (define (a b c (d 3) (e

Re: [racket-users] How to get information about where an error occurs, in a stack trace context?

2015-11-08 Thread Nota Poin
On Monday, November 9, 2015 at 1:38:56 AM UTC, Matthias Felleisen wrote: > Use drracket. Yeah, I would, but it takes about 30 seconds to start up if I disable all the extensions, add another 10 or 20 for the debugger, and then when I type it lags behind at about 0.25s per character. Also it cons

[racket-users] Re: [racket] inspect variable values in backtrace?

2015-11-08 Thread Nota Poin
On Wednesday, March 2, 2011 at 5:53:50 PM UTC, Jay McCarthy wrote: > The unstable/debug library That's nice, I suppose, for standardizing the practice of sticking printf statements here and there for function results. It's basically what Matthias was saying, except with some additional forms for

[racket-users] Re: [racket] inspect variable values in backtrace?

2015-11-08 Thread Nota Poin
On Wednesday, March 2, 2011 at 5:53:50 PM UTC, Jay McCarthy wrote: > The unstable/debug library That's nice, I suppose, for standardizing the practice of sticking printf statements here and there for function results. It's basically what Matthias was saying, except with some additional forms for

[racket-users] Re: racket users fight for their right to colon keywords

2015-11-08 Thread Nota Poin
On Wednesday, October 14, 2015 at 3:50:44 PM UTC, Neil Van Dyke wrote: > (foo :abc 1 :xyx 42) What I want is implicit keyword names for arguments with defaults. So instead of: (define (foo #:bar? (bar? #f) #:foo (foo 42) #:some-variable-name (some-variable-name 3)) ...) and (foo #:bar? #t

[racket-users] How to get information about where an error occurs, in a stack trace context?

2015-11-08 Thread Nota Poin
I'll have code like this: #lang racket/base (define (baz foo) (error 'whoops)) (define (bar ber) (baz ber)) (define (foo ber) (let ((a 3)) (if (and (= a 3) (= (* a 9) 27) (bar ber) (list? (list 1 2 3 4)))

Re: [racket-users] Long-term Runtime session state

2015-10-30 Thread Nota Poin
On Wednesday, October 14, 2015 at 12:30:54 AM UTC, Daniel Feltey wrote: > Some of the verbosity of units can be reduced using the "inference" features > that Racket's unit system provides. Hmm, I gave it a shot, and this seems to work. Not sure if it'd be especially useful. But fwiw -- You rec

Re: [racket-users] Long-term Runtime session state

2015-10-13 Thread Nota Poin
On Tuesday, October 13, 2015 at 11:40:12 PM UTC, Alexis King wrote: > units Oh uh, conceivably you could have "code" that provided a live session object on linking, and handled session refreshing internally, then just link that with units that have session dependant code. I just never found any

Re: [racket-users] Long-term Runtime session state

2015-10-13 Thread Nota Poin
On Tuesday, October 13, 2015 at 11:40:12 PM UTC, Alexis King wrote: > Have you taken a look at parameters? Short answer: yes. Long answer: they're convenient thread-local globals, but still feel like globals to me. (define a (make-parameter 0)) (define (called-at-hopefully-regular-intervals) (

[racket-users] Long-term Runtime session state

2015-10-13 Thread Nota Poin
How do you deal with long-term state that your programming logic depends on, but is only available at run-time? A persistent connection to a database, or an RPC server for instance, or a logged in user account. Do you use parameters? Session objects? Just raw globals? Or something stranger? Thi