markus.pfeiffer
2019-7-12 15:20:36

of course we’re all on slack


alexknauth
2019-7-12 16:18:29

The define-syntax is special because it acts as a bridge between the scope of “run-time code” and “compile-time values”


spdegabrielle
2019-7-12 16:24:30

Next Friday, 19 July at 12pm–3pm there will be an impromptu Racket meetup at the cafe at the British Library ‘The Last Word’. https://goo.gl/maps/M62e4b9JK7c1oaA69

No agenda. All welcome. Spread the word!

I’ll be drinking tea, eating cake(I hope), and will be easily identified as a the man with racket logo on his laptop. Updates on this thread. updates on #uk


zenspider
2019-7-12 17:57:15

One thing @tov and I worked out is the ability to macro expand yesterday’s typed syntax into regular racket (I found drracket to be unbearably slow (1.8 gig ram!) and error prone…

#lang racket

(require (for-syntax (prefix-in r: racket)
                     racket/pretty
                     syntax/parse
                     "stlc.rkt"))

(define-syntax (dbg/1 stx)
  (syntax-parse stx
    [(_ e)
     (r:#%app pretty-print (r:#%app syntax->datum (r:#%app expand-once #'e)))
     #'(void)]))

(define-syntax (dbg stx)
  (syntax-parse stx
    [(_ e)
     (r:#%app pretty-print (r:#%app syntax->datum (r:#%app expand #'e)))
     #'(void)]))

(dbg   (let ([a 10]) (+ a 1)))

;; outputs:
#;
'(#%app (lambda (a) (#%app +- a '1)) '10)

(dbg/1 (let ([a 10]) (+ a 1)))

;; outputs:
#;
'(erased
  ((lambda- (a) (erased (#%app- +- a (erased (#%datum- . 1)))))
   (erased (#%datum- . 10))))

zenspider
2019-7-12 19:56:11

zenspider
2019-7-12 19:56:42

save into macracket/main.rkt then raco pkg install ./macracket


alexknauth
2019-7-12 20:35:37

That #lang macracket sounds very similar to #lang agile


zenspider
2019-7-12 20:37:52

¡you’re agile!


sorawee
2019-7-12 21:23:25

Instead of hard-coding a list of modules, I wish it reads the modules from a new variable in info.rkt (project-wide config), and if it doesn’t exist, read from https://docs.racket-lang.org/drracket/drracket-files.html#%28part._.Preference_.Files%29 (system-wide config), etc.


sorawee
2019-7-12 21:23:35

And probably name it #lang default