Giter Club home page Giter Club logo

Comments (9)

rfindler avatar rfindler commented on July 19, 2024 1

I would probably define a judgment-form instead of using ,.

from redex.

leafac avatar leafac commented on July 19, 2024

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.

rfindler avatar rfindler commented on July 19, 2024

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.

leafac avatar leafac commented on July 19, 2024

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.

rfindler avatar rfindler commented on July 19, 2024

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.

polux avatar polux commented on July 19, 2024

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.

polux avatar polux commented on July 19, 2024

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.

rfindler avatar rfindler commented on July 19, 2024

from redex.

polux avatar polux commented on July 19, 2024

Got it. Thanks.

from redex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.