leafac
2017-3-13 11:02:09

Hi all, I wrote an article about PLT Redex https://www.leafac.com/prose/playing-the-game-with-plt-redex/ I’d love to hear your feedback about it. In particular, if you get lost, I’d like to know where. Comments on grammar and spelling are also welcome, since English is not my first language, but aren’t as high priority.


thinkmoore
2017-3-13 14:41:40

just started, but I have a small nit:


thinkmoore
2017-3-13 14:41:46

^ leafac


thinkmoore
2017-3-13 14:42:36

I think it would be more accurate to say you are using “terms of language” as your data structure? or more generally syntax?


thinkmoore
2017-3-13 14:43:04

and that you’re going to define a language to describe which of those are valid states of the game?


thinkmoore
2017-3-13 14:44:37

a really fun post overall!


leafac
2017-3-13 15:24:05

@thinkmoore: Thank you for reading and thank you for your feedback. I believe your observation is correct, I’m going to fix the article.


leafac
2017-3-13 15:27:50

@thinkmoore: How should I acknowledge you for your contribution? (Name and link.)


thinkmoore
2017-3-13 15:28:42

thinkmoore
2017-3-13 15:28:45

but there’s no need…


leafac
2017-3-13 15:30:36

I like to give credit where it’s due, but I respect your right to privacy if you prefer. Let me know if don’t want to be acknowledged.


thinkmoore
2017-3-13 15:31:46

oh no go ahead


leafac
2017-3-13 15:38:29

:+1: I just published a new version including the fix you suggested. Thank you.


notjack
2017-3-13 17:49:37

@leafac That article is really cool. I’ve never used Redex but the article shows how remarkable it is, and I’ll definitely consider it for puzzle solving at least


notjack
2017-3-13 17:56:20

one minor comment: I think the quasiquoting in search-for-solution is unnecessary, match-define doesn’t need it at all and each of the other cases would probably be more readable using list and cons explicitly. Unless there’s some redex-y special reason for the quasiquoting, in which case ignore me :)


leafac
2017-3-13 18:03:47

@notjack: Thank you for your comment. There is no Redex-related reason to use quasiquote in the place you’re mentioning. I tend to prefer quasiquoting to explicit list and cons, just because then the definition of the data looks like its printed form. I’d love to hear more opinions from others regarding readability between these alternatives.


notjack
2017-3-13 18:05:02

That makes sense. My preference would be for lists to print as (list a b c) in the first place.


leafac
2017-3-13 18:06:38

Most of the time it’d be (list 'a 'b 'c ), so I think I prefer the way it currently is.


leafac
2017-3-13 18:08:35

Anyhow, I’d be happy to change the article if people generally think that list and cons is more readable than quasiquoting. Until I collect more feedback on the issue, I’m leaving it as it is.


notjack
2017-3-13 18:09:00

I speak not with consensus, so do not feel obligated to change it


leafac
2017-3-13 18:10:14

Your feedback is certainly appreciated, though. If you have more to say, I’ll be happy to hear. In the meantime, if want to be acknowledged for your contribution to the article so far, please let me know a name and link of your preference.


notjack
2017-3-13 18:10:59

Nah, it was nothing and I don’t have anywhere to link to :)


notjack
2017-3-13 18:11:19

Linking to the article in the racket / scheme subreddit might be worthwhile


leafac
2017-3-13 18:12:58

That is a nice idea. /r/Racket/, I suppose?


notjack
2017-3-13 18:13:20

Yup, there’s also /r/scheme


leafac
2017-3-13 18:17:08

Do you know how the feel about cross-posting?


notjack
2017-3-13 18:18:20

Absolutely no idea :)


leafac
2017-3-13 18:21:36

leafac
2017-3-13 18:21:47

It’s don’t :slightly_smiling_face:


notjack
2017-3-13 18:22:29

well now we know!


greg
2017-3-13 20:46:04

Hmm, define-type seems to blow up raco check-requires on 6.7: $ cat /tmp/foo.rkt #lang typed/racket/base (define-type Foo Any) $ raco check-requires /tmp/foo.rkt (file "/tmp/foo.rkt"): ERROR in (file "/tmp/foo.rkt") /Applications/Racket_v6.7/share/pkgs/typed-racket-lib/typed-racket/typecheck/internal-forms.rkt:190:8: quote-syntax: bad syntax in: (quote-syntax (define-type-alias-internal Foo Any ()) #:local) context...: f183 /Applications/Racket_v6.7/share/pkgs/macro-debugger-text-lib/macro-debugger/analysis/private/get-references.rkt:23:2: recur /Applications/Racket_v6.7/share/pkgs/macro-debugger-text-lib/macro-debugger/analysis/private/get-references.rkt:23:2: recur ... snip ...


samth
2017-3-13 20:47:02

probably there’s a syntax-case pattern match that didn’t learn about #:local in quote-syntax


greg
2017-3-13 20:48:45

@samth like this? (define (analyze/quote-syntax qs-stx) (let ([phases (for/list ([offset '(0 1 -1 2 -2)]) (+ (phase) offset))] [stx (syntax-case qs-stx () [(_quote-syntax x) #'x])]) ... snip ...


samth
2017-3-13 20:48:54

yeah


greg
2017-3-13 20:50:22

@samth I know how to match for #:local but idk what to do with it. :slightly_smiling_face: Should I try to figure this out and submit a PR, or, just point it out to e.g. Ryan?


samth
2017-3-13 20:50:46

you should just ignore it


samth
2017-3-13 20:50:57

and do the same thing as if it wasn’t there