-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b812ae
commit 235f41f
Showing
7 changed files
with
355 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,55 @@ | ||
# TRack | ||
|
||
T(yped)Rack(et) is an experimental in-progress type-checker/compiler I'm writing for | ||
the racket language. Help is appreciated in _any_ of the following domains: | ||
T(yped)Rack(et) is an experimental in-progress type-checker/compiler I'm writing | ||
for the racket language. Help is appreciated in _any_ of the following domains: | ||
|
||
- [ ] Compiler formatting | ||
- [ ] _Any_ enhancement to the codebas | ||
- [ ] _Any_ enhancement to the codebase | ||
- [ ] Environment definitions (e.g. language packs & imported libraries) | ||
- [ ] Test suites | ||
|
||
## Usage | ||
|
||
_unusable right now_ | ||
|
||
## Examples | ||
|
||
Track compiles this | ||
|
||
```racket | ||
(define (f x : String & y : Number -> Number) | ||
(local ([define (g z : Number -> Number) (+ y z)]) | ||
(+ (string->number x) (g y) 5))) | ||
``` | ||
|
||
into this | ||
|
||
```racket | ||
#lang htdp/isl+ | ||
;; f : String Number -> Number | ||
(define (f x y) | ||
(local ( | ||
;; g : Number -> Number | ||
(define (g z) | ||
(+ | ||
y | ||
z | ||
))) | ||
(+ | ||
(string->number | ||
x | ||
) | ||
(g | ||
y | ||
) | ||
5 | ||
))) | ||
``` | ||
|
||
> _yes, i know its ugly. i'm trying to improve the compiler output. or you can | ||
> just run the output over `raco fmt` again._ | ||
## Related | ||
|
||
- [Racket-huh](https://github.com/jokeneversoke/racket-huh) Executes Racket code **in browser** within embeds. | ||
- [Racket-huh](https://github.com/jokeneversoke/racket-huh) - Executes Racket | ||
code **in browser** within embeds. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,19 @@ | ||
#lang htdp/isl+ | ||
;; k : Number Number -> Number | ||
(define (k x y) | ||
"") | ||
;; v : String -> Number | ||
(define (v u) | ||
(string->number | ||
u | ||
)) | ||
(+ | ||
(k | ||
1 | ||
2 | ||
) | ||
(v | ||
"" | ||
) | ||
) | ||
(+ | ||
(v | ||
1 | ||
) | ||
(k | ||
2 | ||
) | ||
) | ||
(k | ||
3 | ||
"" | ||
) | ||
;; f : String Number -> Number | ||
(define (f x y) | ||
(local ( | ||
;; g : Number -> Number | ||
(define (g z) | ||
(+ | ||
y | ||
z | ||
))) | ||
(+ | ||
(string->number | ||
x | ||
) | ||
(g | ||
y | ||
) | ||
5 | ||
))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
|
||
(define (k x : Number & y : Number -> Number) | ||
"") | ||
(define (v u : String -> Number) | ||
(string->number u)) | ||
(+ (k 1 2) (v "3")) | ||
;; wrong example | ||
(+ (v 1) (k 2)) | ||
(k 3 "4") | ||
(define (f x : String & y : Number -> Number) | ||
(local ([define (g z : Number -> Number) (+ y z)]) | ||
(+ (string->number x) (g y) 5))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.