samth
2018-8-20 13:31:14

but the drdr results suggest that it might be something else I don’t understand


ben
2018-8-20 15:15:50

thanks for the notice — that test expects (= 1) to raise an arity error, but it doesn’t anymore (https://github.com/racket/racket/commit/412818949915f6ecbf9a9c31915dcafdf7016762); I’ll update the test


ben
2018-8-20 17:45:33

@dan do you want to turn https://github.com/racket/slideshow/pull/4 into a package?


ben
2018-8-20 17:46:33

(I’m thinking I want to use it, and so I was thinking about making a package for it myself)


dan
2018-8-20 17:59:23

@ben I don’t know if it really belongs in its own package rather than part of pict of slideshow, at one point it looks like it was (is?) part of unstable/gui/pict/plt-logo (http://docs.racket-lang.org/unstable-gui/pict.html?q=color#%28def._%28%28lib._unstable%2Fgui%2Fpict%2Fplt-logo..rkt%29._make-plt-title-background%29%29) and there’s also a pict exported from Jay’s puresuri package (http://docs.racket-lang.org/puresuri/index.html?q=plt-slide#%28def._%28%28lib._puresuri%2Flib%2Ftitle..rkt%29._plt-title-background%29%29) those are a little less customizable than the version in my pull request though


ben
2018-8-20 18:02:00

Ok, the unstable logo probably works for me. (I like the idea of a separate package)


blerner
2018-8-21 00:35:52

Hopefully quick question about at-exp syntax, functions, and quoting/unquoting: In the following code, the first two lines work, but the third does not: #lang at-exp racket @(define (foo x) (* 2 (string-length x))) `(1 "a" #t ,@(foo "2")) `(1 "a" #t ,@foo{2})


blerner
2018-8-21 00:36:55

If I understand the docs right, @foo{2} is the same thing as (foo "2"), so I would expect the two lines to evaluate identically, to '(1 "a" #t . 2)


blerner
2018-8-21 00:37:29

Instead, I get “unquote-splicing: contract violation / expected: list? / given: #<procedure:foo>”


blerner
2018-8-21 00:38:13

(This is excerpted and reduced from a more real-world scenario; obviously this particular code is meaningless…)


blerner
2018-8-21 00:38:45

Why doesn’t the second line work?


shu--hung
2018-8-21 01:14:58
`(1 "a" #t ,@foo{2})   ;; doesn't work
`(1 "a" #t , @foo{2})  ;; ok

shu--hung
2018-8-21 01:15:24

I don’t know how lexing and parsing work though..


blerner
2018-8-21 01:18:31

O_o a space matters here?


shu--hung
2018-8-21 01:19:17

well, I have no clue how lexing and read-table interact with each other


shu--hung
2018-8-21 01:20:01

from the macro stepper, the former is the same as `(1 "a" #t ,@foo {2}) while the second is `(1 "a" #t ,(foo "2"))


shu--hung
2018-8-21 01:20:10

{2} is just (2)


blerner
2018-8-21 01:20:40

oooh, well, they actually give slightly different answers — the first ,@(foo "2") version yields '(1 "a" #t . 2), while the spaced version gave me '(1 "a" #t 2) — note the lack of non-list dot


blerner
2018-8-21 01:22:27

confused


shu--hung
2018-8-21 01:24:07

ohhh I realized that ,@ is unquote splicing


shu--hung
2018-8-21 01:25:55

(that is, ,@ is a thing)


blerner
2018-8-21 01:26:28

oh.


blerner
2018-8-21 01:26:33

right.


blerner
2018-8-21 01:30:33

thanks for the reminder :slightly_smiling_face:


mflatt
2018-8-21 01:53:04

@blerner A not-obvious twist in@ notation: if you put , after the @, then it’s effectively moved before the @. So, you could use @,foo{2}.


blerner
2018-8-21 01:54:10

Thanks. Is that documented somewhere that I didn’t notice, or is that just some expertise I haven’t acquired yet?



blerner
2018-8-21 01:57:32

I saw that part. I didn’t understand any of it, tbh


blerner
2018-8-21 01:58:28

I think I didn’t understand the phrase “punctuation prefix”; I still had each of backtick, comma, apostrophe in my head as one-key shortcuts for longer primitive names, rather than as a “prefix” of anything.


blerner
2018-8-21 02:00:00

so many subtleties! thanks for the reference