[racket-users] E' CONSULENTE FINANZIARIO CRIMINALISSIMO: PIETRO CARDONE DI BANCA GENERALI. TRAMA NAZISTAMENTE.................CON IL NOTO PEDOFILO ASSASSINO PAOLO BARRAI, GIA' FINITO IN CARCERE 3 VOLT

2019-04-19 Thread 'Michael Chinnick Mandarin Exof Nazi-MorganStanley' via Racket Users
UN TESTO DICENTE ASSOLUTE VERITA'. DA PARTE DEL MIO AMICO E COLLEGA ANDREAS NIGG DI ZURIGO. SALUTI DA HONG KONG. MICHAEL CHINNICK. MANDARIN FINANCIAL INVESTMENTS. HONG KONG. ASIA. E' CONSULENTE FINANZIARIO CRIMINALISSIMO: PIETRO CARDONE DI BANCA GENERALI. TRAMA NAZISTAMENTE.CON

Re: [racket-users] make extensions or replacements

2019-04-19 Thread 'John Clements' via Racket Users
There’s a paper at the most recent ICFP from Simon Peyton Jones (et al., I’m guessing) on make languages, IIRC. John > On Apr 16, 2019, at 2:09 PM, Greg Hendershott > wrote: > > I have a shallow understanding of GNU Make, which is only somewhat > less-shallow as a result of recently

Re: [racket-users] Inline tests for library and corresponding lang result in a loading cycle

2019-04-19 Thread Matthew Butterick
> On Apr 19, 2019, at 1:52 PM, zeRusski wrote: > > Made me curious. Maybe I'm dense, but do you suggest that I delete > foo/bar/lang and add this to foo/bar/main.rkt > > (module reader syntax/module-reader > foo/bar/main) > > If I do that though #lang foo/bar no longer works, compiler

Re: [racket-users] catch and bind an unbound id in a macro

2019-04-19 Thread zeRusski
Luke, thanks. You were the first to get there and somehow I missed your reply :( On Friday, 19 April 2019 22:31:41 UTC+1, luke.whittlesey wrote: > > `identifier-binding` might be useful if a binding can be defined outside > of set/define > > >

[racket-users] Re: catch and bind an unbound id in a macro

2019-04-19 Thread Ryan Kramer
For what it's worth, Matthias' original answer has solved an issue I had. I was using identifier-binding for something very similar and it worked fine, except in my scribble examples. I had example 1 define foo, but then example 2 (with the same evaluator) would not "see" foo via

Re: [racket-users] catch and bind an unbound id in a macro

2019-04-19 Thread Matthias Felleisen
Yes, I wanted to recall this trick for you and overshot :) > On Apr 19, 2019, at 6:04 PM, zeRusski wrote: > > Matthias, FWIW your first solution gave me a flashback from last year's > Summer School. I remember using this trick. Now I hope I don't forget when I > actually need it. > >

Re: [racket-users] catch and bind an unbound id in a macro

2019-04-19 Thread zeRusski
Matthias, FWIW your first solution gave me a flashback from last year's Summer School. I remember using this trick. Now I hope I don't forget when I actually need it. Thank you Michael and Matthias -- You received this message because you are subscribed to the Google Groups "Racket Users"

Re: [racket-users] catch and bind an unbound id in a macro

2019-04-19 Thread zeRusski
On Friday, 19 April 2019 22:39:10 UTC+1, Michael Murdock MacLeod wrote: > > I'm in no ways a macro expert, but will this work? It uses > identifier-binding > to check if the identifier for the hash table is bound. > Yep, looks like the winner. I should've inferred from the fact that "unbound

Re: [racket-users] catch and bind an unbound id in a macro

2019-04-19 Thread Matthias Felleisen
I should have know better: (define-syntax (set/define stx) (syntax-case stx () [(_ id key val) (identifier-binding #'id) #`(begin (hash-set! h 'key val) h)] [(_ id key val) #'(begin (define id (make-hash)) (set/define id key val))]))

Re: [racket-users] catch and bind an unbound id in a macro

2019-04-19 Thread Michael Murdock MacLeod
I'm in no ways a macro expert, but will this work? It uses identifier-binding to check if the identifier for the hash table is bound. (define-syntax (set/define stx) (syntax-case stx () [(_ ht key value) (cond [(identifier-binding #'ht) #'(hash-set! ht key value)]

Re: [racket-users] catch and bind an unbound id in a macro

2019-04-19 Thread zeRusski
Not quite what I had in mind. The following examples must all work without errors: #lang racket ;; set/define defined here (set/define h a 1) (set/define h a 2) (hash-set! h 'b 42) (define bar (make-hash)) (set/define bar a 1) (define (foo) (set/define local-h a 1) (set/define local-h a

Re: [racket-users] catch and bind an unbound id in a macro

2019-04-19 Thread Luke Whittlesey
`identifier-binding` might be useful if a binding can be defined outside of set/define https://docs.racket-lang.org/reference/stxcmp.html?q=identifier-binding#%28def._%28%28quote._~23~25kernel%29._identifier-binding%29%29 On Fri, Apr 19, 2019 at 4:55 PM Matthias Felleisen wrote: > > I had the

Re: [racket-users] catch and bind an unbound id in a macro

2019-04-19 Thread Matthias Felleisen
I had the impression that you want to create the hashtable when it’s not there and use it when it is: #lang racket (define-syntax (set/define stx) (syntax-case stx () [(_ id key val) (syntax-local-value #'id (lambda () #f)) (with-syntax ([h (car (syntax-local-value #'id

Re: [racket-users] Inline tests for library and corresponding lang result in a loading cycle

2019-04-19 Thread zeRusski
> > PS the `lang/reader.rkt` fandango is no longer necessary in modern Racket; > if you like, you can use a `reader` submodule in your primary language file. > Made me curious. Maybe I'm dense, but do you suggest that I delete foo/bar/lang and add this to foo/bar/main.rkt (module reader

[racket-users] catch and bind an unbound id in a macro

2019-04-19 Thread zeRusski
Here's what I've been trying and failing to do in Racket. The smallest example I could think of is a macro that sets a key in a hash-table, so basically this transformation: (set/define ht 'key 42) ;; => (hash-set! ht 'key 42) but if ht there is an unbound identifier it must bind it to a

Re: [racket-users] Inline tests for library and corresponding lang result in a loading cycle

2019-04-19 Thread Matthew Butterick
> On Apr 19, 2019, at 11:01 AM, zeRusski wrote: > One hypothesis I have is that the (module lang-test foo/bar ...) doesn't > resolve > to the language but rather to the foo/bar.rkt Right. "if the unquoted path contains no /, then require automatically adds a "/main" to the reference". [1]

[racket-users] Inline tests for library and corresponding lang result in a loading cycle

2019-04-19 Thread zeRusski
I wrote a library foo/bar.rkt and I also allow to use it as a #lang. Roughly the structure is like this: foo ├── bar │ ├── lang │ │ └── reader.rkt │ └── main.rkt ├── bar.rkt Most of the work happens in the library foo/bar.rkt, so naturally all of the tests reside there. I'd like to be

Re: [racket-users] db module + SQLite driver + 'ON CONFLICT' = syntax error

2019-04-19 Thread Ryan Culpepper
On 4/18/19 23:53, David Storrs wrote: On Thu, Apr 18, 2019 at 5:42 PM Ryan Culpepper > wrote: Use "INSERT OR IGNORE" instead. See https://sqlite.org/lang_conflict.html, 3rd paragraph. Yep.  Unfortunately, this was a simplified case of wanting to use OR DO

Re: [racket-users] db module + SQLite driver + 'ON CONFLICT' = syntax error

2019-04-19 Thread Ryan Culpepper
Use "INSERT OR IGNORE" instead. See https://sqlite.org/lang_conflict.html, 3rd paragraph. Ryan On 4/18/19 23:28, David Storrs wrote: On Thu, Apr 18, 2019 at 4:48 PM Jon Zeppieri > wrote: It might well be the SQLlite version. This is a pretty new feature.

Re: [racket-users] Assertion failures in bigfloat package

2019-04-19 Thread Sam Tobin-Hochstadt
On 1: the best thing to do is figure out (probably with logging) which call to MPFR and what arguments produce the assertion. 2: I don't think there's any intended non-determinism. Sam On Fri, Apr 19, 2019 at 12:56 AM wrote: > > Hello everyone, > > I'm using Racket's MPFR bindings to build an