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.
just started, but I have a small nit:
^ leafac
I think it would be more accurate to say you are using “terms of language” as your data structure? or more generally syntax?
and that you’re going to define a language to describe which of those are valid states of the game?
a really fun post overall!
@thinkmoore: Thank you for reading and thank you for your feedback. I believe your observation is correct, I’m going to fix the article.
@thinkmoore: How should I acknowledge you for your contribution? (Name and link.)
but there’s no need…
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.
oh no go ahead
:+1: I just published a new version including the fix you suggested. Thank you.
@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
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 :)
@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.
That makes sense. My preference would be for lists to print as (list a b c)
in the first place.
Most of the time it’d be (list 'a 'b 'c )
, so I think I prefer the way it currently is.
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.
I speak not with consensus, so do not feel obligated to change it
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.
Nah, it was nothing and I don’t have anywhere to link to :)
Linking to the article in the racket / scheme subreddit might be worthwhile
That is a nice idea. /r/Racket/
, I suppose?
Yup, there’s also /r/scheme
Do you know how the feel about cross-posting?
Absolutely no idea :)
It’s don’t :slightly_smiling_face:
well now we know!
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 ...
probably there’s a syntax-case
pattern match that didn’t learn about #:local
in quote-syntax
@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 ...
yeah
@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?
you should just ignore it
and do the same thing as if it wasn’t there