Comments (9)
I would probably define a judgment-form instead of using ,
.
from redex.
I disabled check-clauses
in judgement-form.rkt
by comment out its body and making it return rest
. The error stays the same.
I went even further and redefined raise-syntax-error
to a no-op in the scope of judgement-form.rkt
. The error stays the same.
I think this rules out the "best case", i.e., a more relaxed well-formedness check isn't going to solve the problem. Do you agree?
In order to explore the "worst case", I believe I should start in compile-clause
. There are many things in it that go over my head, so any directions from you are going to help a lot.
Thanks so much for the feedback, @rfindler
from redex.
I think that the call that raises the error is this one:
https://github.com/racket/redex/blob/master/redex-lib/redex/private/judgment-form.rkt#L141
from redex.
Of course, you are right. Disabling the check—i.e., returning cs
instead of raising an error with raise-ellipsis-depth-error
—changes the error message in the test to "syntax: missing ellipsis with pattern variable in template in: τ", referring to the τ
that occurs outside amb
in the conclusion of the rule. With that, the easy route has been definitely ruled, I think.
Now would be the time to understand the system a bit better to come up with a solution. I believe I'll need to change how the binding constraint is generated in the case at hand. When you said Redex uses racket/datum
, did you mean syntax/datum
? I'm studying now how it works.
Side question: When you are working on this, how do you debug? The Debugger in DrRacket fails right away, because the code fails in macro expansion at compile time. The Macro Stepper helps, by allowing me to see the macro expansions, but it is limited in that I can't, for example, set breakpoints.
Thank you!
from redex.
Yes, I meant syntax/datum! Thanks, duh.
When I'm working on this, I use the stacktrace information from syntax errors (that's how I pointed you to the line above) and I use printf debugging, and I combine that with some experience in knowing when things run in this code and just in Racket macros in general. Also I tried to work carefully with small input programs and test individual functions. But generally I don't think using the macro stepper or the debugger is probably what I would do for this particular problem. I think using the macro stepper might be helpful to you to figure out how some of the pieces of Redex fit together, tho. I mostly just try to use my memory for that job -- but the macro stepper is better than my memory and I should be using it more than I do.
from redex.
I was following the tutorial and found this discussion after hitting this issue. Is the following still the best way to answer question 6 for now?
[(types-exercise-6 Γ e t_2) ...
(side-condition ,(andmap (curry equal? (term t_1)) (term (t_2 ...))))
-------------------------
(types-exercise-6 Γ (amb t_1 e ...) t_1)]
from redex.
Ack. I was merely copy-pasting this solution from the other thread but I guess my question was: is a side-condition the best solution for now? Sounds like the answer is yes. Thanks!
from redex.
from redex.
Got it. Thanks.
from redex.
Related Issues (20)
- Defining mutually recursvie judgments/meta-functions HOT 2
- Feature request: tag-with-names for apply-reduction-relation* HOT 2
- test-->>∃ #:steps n passes test if n > than the number of actual reduction steps for a term. HOT 4
- `traces` doesn't draw arrows after "fix layout" HOT 5
- `stepper` doesn't display whole term... unless I *narrow* its box?
- Feature Request: `stepper` with judgment-form use rule names
- Feature request: adjust font for `stepper` HOT 3
- Redex rejects literals at different ellipsis depths in binding form declarations HOT 1
- Generating random expressions sometimes results in an infinite loop
- where/error failures give no information about source of error HOT 6
- where/error failures don't tell you what failed to match
- using judgment-holds within define-relation HOT 1
- Redex's reduction graph windows sneakily hide part of term reductions HOT 1
- where/error doesn't report errors sometimes HOT 8
- define-metafunction does not check type signature on LHS HOT 3
- Docs missing a word I can't fill in. HOT 1
- `derivation/ps` always causes an error by calling a non-existent method HOT 1
- Default rendering font changed between Racket v8.8 and v8.9? HOT 4
- Redex PDF output contains a wrong font, while Racket REPL renders the correct font HOT 2
- Reduce space between rendered rules of a judgement form HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redex.