Re: [racket-users] Obtain use-site source information

2018-11-21 Thread Matthew Butterick
> On Nov 21, 2018, at 6:44 PM, Shu-Hung You > wrote: >> (PS ignore "at L ..." — apparently `gensym` in RacketCS is broken.) Correction: it's not broken. I overlooked the fact that `gensym` is allowed to produce symbols that print the same way, though sometimes it does not. -- You received

Re: [racket-users] using `define-runtime-path` inside macros

2018-11-21 Thread Alex Harsanyi
On Friday, August 31, 2018 at 11:11:29 PM UTC+8, Matthew Butterick wrote: > > > On Aug 31, 2018, at 3:25 AM, Alex Harsanyi > wrote: > > Is there a way to write this macro such that the runtime path is defined > relative to the location of the file that uses `define-sql-statement`? > > > One opti

Re: [racket-users] Obtain use-site source information

2018-11-21 Thread Shu-Hung You
Thanks! However, I am trying to avoid changing USE. The trouble is that there are too many macros using X that I don't understand, and these macros themselves are more than one layers deep. It is nearly impossible to thread the syntax property through the macros.On Wed, Nov 21, 2018 at 7:30 PM Matt

Re: [racket-users] Obtain use-site source information

2018-11-21 Thread Matthew Butterick
(PS ignore "at L ..." — apparently `gensym` in RacketCS is broken.) > ;; Result: > ;; "at L (unsaved-editor:24.3) ; #f #f" > ;; "at L (unsaved-editor:25.3) ; #f #f" > ;; "at L (unsaved-editor:26.0) ; #f #f" > ;; "at L (unsaved-editor:27.0) ; #f #f" -- You received this message because you are s

Re: [racket-users] Obtain use-site source information

2018-11-21 Thread Matthew Butterick
> On Nov 21, 2018, at 12:44 PM, Shu-Hung You > wrote: > > It works, but it would be better if (X 'USE) can log information about > its uses at B and C in addition to the source location A for debugging > purpose. If I don't want to change the implementation of USE, is there > a way for X to obt

Re: [racket-users] Destructuring a list in (for ...)

2018-11-21 Thread Brian Adkins
I like that. I really need to level up on Racket macros! On Wednesday, November 21, 2018 at 3:19:55 PM UTC-5, Matthew Butterick wrote: > > > On Nov 21, 2018, at 9:30 AM, Brian Adkins > wrote: > > Thanks guys. I think I can live with: > > (for ([(i j) (in-dict '(("a" . 1) ("b" . 20)))]) > (d

[racket-users] Re: Orchestrate SQL migrations with Racket

2018-11-21 Thread Alex Harsanyi
I implemented my own migration code for my Racket application and I am personally happy with it. It can only upgrade (from old to new) and not downgrade a database, however it supports showing a GUI progress dialog for the migration process (one step for each SQL statement applied). Not sure how

[racket-users] Orchestrate SQL migrations with Racket

2018-11-21 Thread P. Baillet
Hi list, I've been playing with Racquel a bit and I've been wondering if any of you know/use some kind of migration framework to run DB migrations on databases. I'd looking for something that gives the same UX as when using Rails to manage migrations: - instrument the DB internals to keep trac

[racket-users] Obtain use-site source information

2018-11-21 Thread Shu-Hung You
I have a macro (let's called it X) that generates unique symbols at all its uses. I need all its uses to be distinguishable from each other. (define-syntax X (syntax-parser [(_ stx) (define label (gensym 'L)) #`(log-error "at ~a (~a) ; ~a ~a" '#,label

[racket-users] Re: Announcing Minimalistic Languages track at FOSDEM 2019

2018-11-21 Thread Jérôme Martin
Update: I submitted a lighting talk called "Why JSON when you can DSL?". The challenge is to make it fit into 15 minutes, but if we don't have other talks, I guess I could do it multiple times in the day or just make it longer. I also submitted a workshop to actually practice what I talk about.

Re: [racket-users] Destructuring a list in (for ...)

2018-11-21 Thread Matthew Butterick
> On Nov 21, 2018, at 9:30 AM, Brian Adkins wrote: > > Thanks guys. I think I can live with: > > (for ([(i j) (in-dict '(("a" . 1) ("b" . 20)))]) > (display (list i j))) > > I suppose I could also write something analogous to in-dict that would do > what I want. Maybe in-tuple ? Or per

Re: [racket-users] Destructuring a list in (for ...)

2018-11-21 Thread Brian Adkins
Thanks guys. I think I can live with: (for ([(i j) (in-dict '(("a" . 1) ("b" . 20)))]) (display (list i j))) I suppose I could also write something analogous to in-dict that would do what I want. Maybe in-tuple ? On Wednesday, November 21, 2018 at 11:58:49 AM UTC-5, Vincent St-Amour wrote

Re: [racket-users] Destructuring a list in (for ...)

2018-11-21 Thread Vincent St-Amour
`in-dict` can get you mostly there. (for ([(i j) (in-dict '(("a" 1) ("b" 20)))]) (display (list i j))) > (a (1))(b (20)) If you have lists of pairs instead of lists of lists, you'll get the same result as the hash case. Vincent On Wed, 21 Nov 2018 10:55:23 -0600, Brian Adkins wrote: > > I

Re: [racket-users] Destructuring a list in (for ...)

2018-11-21 Thread Sam Tobin-Hochstadt
You can use `in-dict` on an alist, and it will behave like the default sequence behavior for hashes. Note that it assumes the elements are cons pairs, not lists, so the values in your example will be '(1) and '(20). Sam On Wed, Nov 21, 2018 at 11:55 AM Brian Adkins wrote: > > I thought it was pos

[racket-users] Destructuring a list in (for ...)

2018-11-21 Thread Brian Adkins
I thought it was possible to destructure a list in for, but I've been searching/experimenting for a while without success. I noticed this example in the docs: (for ([(i j) #hash(("a" . 1) ("b" . 20))]) (display (list i j))) So, I assumed I could do this: (for ([(i j) '(("a" 1) ("b" 20))])