Re: [racket-users] Notifier/subscriber pattern, preventing event cycles: What's the best practice?

2018-08-09 Thread Erich Rast
On Wed, 8 Aug 2018 19:36:10 -0400 David Vanderson wrote: > > Is there a better solution to this problem? How do mature > > notifier/subscriber frameworks deal with these kind of problems? > > > The most straightforward solution I've seen puts the responsibility > on the view.  When the view

Re: [racket-users] inspecting inferred types in typed racket

2018-08-09 Thread Alvin Cheung
Edit: I'm not even sure how to do (1) without (2) given that it requires multiple evaluations of the same input. Any pointers would be appreciated. On 8/9/18 7:02 PM, Alvin Cheung wrote: Thanks. I am building a language with the same syntax as typed racket, with the plan to (1) run the input

Re: [racket-users] inspecting inferred types in typed racket

2018-08-09 Thread Ben Greenman
Typed Racket first runs the macro expander, and then type checks the expanded program. If your implementation can type check an expanded program too, then you can probably get started by copy/pasting typed racket's #%module-begin and inserting a new pass over the program just after the optimizer.

Re: [racket-users] inspecting inferred types in typed racket

2018-08-09 Thread Alvin Cheung
Thanks. I am building a language with the same syntax as typed racket, with the plan to (1) run the input as a typed racket program to type check, and then (2) run it using my implementation, ideally with the possibility of querying for the inferred types of the variables and functions in the

Re: [racket-users] inspecting inferred types in typed racket

2018-08-09 Thread Ben Greenman
I don't think so, but check `typed-racket/types/type-table`: https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/types/type-table.rkt#L20 -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this

[racket-users] Re: bf "module: initial import is not a well-formed module path"

2018-08-09 Thread Zeta Convex
OK. I had a partial success. reader.rkt needs to start with something like: #lang s-exp syntax/module-reader "language.rkt" #:read my-read #:read-syntax my-read-syntax ... except that I can't run my BF program (hello2.rkt) from an arbitrary directory, because it doesn't know where to locate

[racket-users] bf "module: initial import is not a well-formed module path"

2018-08-09 Thread Zeta Convex
I'm following the example from "F*dging up a Racket" at https://www.hashcollision.org/brainfudge/index.html I set up a project within ~/.racket/6.12/collects: . ├── bf │ ├── hello2.rkt │ ├── hello.rkt │ ├── lang │ │ └── reader.rkt │ ├── language.rkt │ ├── parser.rkt │

Re: [racket-users] bf "module: initial import is not a well-formed module path"

2018-08-09 Thread Shu-Hung You
Change the first few lines of lang/reader.rkt to: #lang s-exp syntax/module-reader bf/language #:read my-read #:read-syntax my-read-syntax ;; ... And just install the entire directory as a package using raco pkg install. This could take a while. If you want to make it faster, just skip building

Re: [racket-users] bf "module: initial import is not a well-formed module path"

2018-08-09 Thread Zeta Convex
On Thursday, 9 August 2018 21:34:16 UTC+1, Shu-Hung You wrote: > > Change the first few lines of lang/reader.rkt to: > > #lang s-exp syntax/module-reader > *bf/language * > #:read my-read > #:read-syntax my-read-syntax > ;; ... > > Ah yes, that did it! Thanks! And just install the entire

Re: [racket-users] bf "module: initial import is not a well-formed module path"

2018-08-09 Thread Shu-Hung You
On Thu, Aug 9, 2018 at 3:42 PM, Zeta Convex wrote: > > > On Thursday, 9 August 2018 21:34:16 UTC+1, Shu-Hung You wrote: >> >> Change the first few lines of lang/reader.rkt to: >> >> #lang s-exp syntax/module-reader >> bf/language >> #:read my-read >> #:read-syntax my-read-syntax >> ;; ... >> > Ah