Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefab structures #6

Open
dvanhorn opened this issue Feb 5, 2021 · 4 comments
Open

Prefab structures #6

dvanhorn opened this issue Feb 5, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@dvanhorn
Copy link
Member

dvanhorn commented Feb 5, 2021

Add support for prefab structures. An instance of a prefab structure can be represented as a heap-allocated structure that consists of a key and an array of field values. The key should be a symbol (so this will depend on #5) and you should implement make-prefab-struct as described in the Racket docs. (This does not need to support other kinds of keys beyond symbols).

After adding run-time support for prefab instances, add prefab struct definitions to set of allowable definitions in a program. A prefab struct definition should bind names for a constructor, predicate, and accessor functions for instances of a prefab.

@dvanhorn dvanhorn added the enhancement New feature or request label Feb 5, 2021
@dvanhorn dvanhorn mentioned this issue Feb 5, 2021
@aaron-green19 aaron-green19 self-assigned this Feb 9, 2021
@OlasubomiEfuniyi OlasubomiEfuniyi self-assigned this Feb 19, 2021
@dvanhorn
Copy link
Member Author

Any updates on this?

@OlasubomiEfuniyi
Copy link
Contributor

The compiler is done and passing all the tests. This includes tests for "make-prefab-struct" and struct definitions. We just need to add prefab structs to the interpreter.

@abrassel
Copy link

abrassel commented Mar 8, 2021

Hi, I'm merging onto your feature because I need the extra types for #22 . When I run the tests on your branch I get a single test failure:

raco test: "test/compile.rkt"
raco test: "test/interp.rkt"
match: no matching clause for #f
  context...:
   /usr/share/racket/collects/racket/match/runtime.rkt:24:0: match:error
   /home/alex/Documents/the-838e-compiler/villain/interp.rkt:154:0: interp-env*
   /usr/share/racket/collects/racket/match/compiler.rkt:507:40: f46
   /home/alex/Documents/the-838e-compiler/villain/interp.rkt:154:0: interp-env*
   /usr/share/racket/collects/racket/match/compiler.rkt:507:40: f46
   /usr/share/racket/pkgs/rackunit-lib/rackunit/private/check.rkt:121:16
   body of "/home/alex/Documents/the-838e-compiler/villain/test/interp.rkt"
   /usr/share/racket/pkgs/compiler-lib/compiler/commands/test.rkt:77:2
   body of (submod "/usr/share/racket/pkgs/compiler-lib/compiler/commands/test.rkt" process)
   body of top-level
interp.rkt: raco test: non-zero exit: 1
raco test: (submod "test/test-programs/get-progs.rkt" test)
raco test: "test/test-progs.rkt"
raco test: "test/test-runner.rkt"
1/496 test failures

@OlasubomiEfuniyi
Copy link
Contributor

Yeah, that's because we are still finishing up the interpreter. Maybe just comment out the prefab structure tests for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants