Similar to functions like stx-car from syntax/stx, this PR adds:
stx-xexpr?
stx-txexpr?
stx-txexpr->values
stx-txexpr->list
stx-txexpr-tag
stx-txexpr-attrs
stx-txexpr-elements
Similar to functions like `stx-car` from `syntax/stx`, this PR adds:
- `stx-xexpr?`
- `stx-txexpr?`
- `stx-txexpr->values`
- `stx-txexpr->list`
- `stx-txexpr-tag`
- `stx-txexpr-attrs`
- `stx-txexpr-elements`
I can take the container functions. I would be unwise to accept the others, because I don’t know anything about syntax-parse and thus cannot maintain the code. (It would also need docs & tests.)
Why not create a separate stx-txexpr package that depends on txexpr but adds your stx module to the txexpr collection.
I can take the `container` functions. I would be unwise to accept the others, because I don’t know anything about `syntax-parse` and thus cannot maintain the code. (It would also need docs & tests.)
Why not create a separate `stx-txexpr` package that depends on `txexpr` but adds your `stx` module to the `txexpr` collection.
What if I took out just the two syntax-parse forms, and left the functions like stx-txexpr? and stx-txexpr->values? I could define the syntax-parse forms in terms of those functions.
What if I took out just the two `syntax-parse` forms, and left the functions like `stx-txexpr?` and `stx-txexpr->values`? I could define the syntax-parse forms in terms of those functions.
Also, I remain unclear about the overall purpose of these functions. I thought stx-txexpr-tag? would be a predicate for syntax objects that contain txexpr-tag?. But that's not so — it also returns #true for ordinary txexpr-tags.
Still would need tests & docs.
Also, I remain unclear about the overall purpose of these functions. I thought `stx-txexpr-tag?` would be a predicate for syntax objects that contain `txexpr-tag?`. But that's not so — it also returns `#true` for ordinary `txexpr-tag`s.
Yes, just like stx-pair? returns true on both normal conss and syntax containing them and stx-null? returns true on both normal '() and syntax containing it.
Yes, just like `stx-pair?` returns true on both normal `cons`s and syntax containing them and `stx-null?` returns true on both normal `'()` and syntax containing it.
All the functions in syntax/stx work just as well on normal non-syntax versions as they do on full syntax versions. And one of the reasons you would use stx->list instead of syntax->list is for situations like (cons 1 (cons 3 #'(3 4))), where it's both a "normal" cons and could-be-flattened-into-a-normal-list, but part of the list inside still needs to be converted.
I will delete the syntax-parse forms and add tests and docs.
All the functions in `syntax/stx` work just as well on normal non-syntax versions as they do on full syntax versions. And one of the reasons you would use `stx->list` instead of `syntax->list` is for situations like `(cons 1 (cons 3 #'(3 4)))`, where it's both a "normal" cons and could-be-flattened-into-a-normal-list, but part of the list inside still needs to be converted.
I will delete the syntax-parse forms and add tests and docs.
Similar to functions like
stx-car
fromsyntax/stx
, this PR adds:stx-xexpr?
stx-txexpr?
stx-txexpr->values
stx-txexpr->list
stx-txexpr-tag
stx-txexpr-attrs
stx-txexpr-elements
I can take the
container
functions. I would be unwise to accept the others, because I don’t know anything aboutsyntax-parse
and thus cannot maintain the code. (It would also need docs & tests.)Why not create a separate
stx-txexpr
package that depends ontxexpr
but adds yourstx
module to thetxexpr
collection.What if I took out just the two
syntax-parse
forms, and left the functions likestx-txexpr?
andstx-txexpr->values
? I could define the syntax-parse forms in terms of those functions.Still would need tests & docs.
Also, I remain unclear about the overall purpose of these functions. I thought
stx-txexpr-tag?
would be a predicate for syntax objects that containtxexpr-tag?
. But that's not so — it also returns#true
for ordinarytxexpr-tag
s.Yes, just like
stx-pair?
returns true on both normalcons
s and syntax containing them andstx-null?
returns true on both normal'()
and syntax containing it.OK, if it corresponds to an existing idiom, that’s fine.
All the functions in
syntax/stx
work just as well on normal non-syntax versions as they do on full syntax versions. And one of the reasons you would usestx->list
instead ofsyntax->list
is for situations like(cons 1 (cons 3 #'(3 4)))
, where it's both a "normal" cons and could-be-flattened-into-a-normal-list, but part of the list inside still needs to be converted.I will delete the syntax-parse forms and add tests and docs.
I have added tests and docs.
Thanks for catching those typos
Thank you for the PR
87cd845136
.Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.