forked from yhsiang/yin
-
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.
make record types first-class only (not sure if it is good idea)
- Loading branch information
Showing
2 changed files
with
19 additions
and
11 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
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,14 +1,24 @@ | ||
-- (define f | ||
-- (fun (x y) | ||
-- (declare [x :type Int :default 1] | ||
-- [y :type Bool :default true]) | ||
-- [x y])) | ||
|
||
|
||
(define f | ||
(fun (x y) | ||
-- (declare [x :type Int :default 1] | ||
-- [y :type Bool :default true]) | ||
(fun ([x :type Int :default 10] | ||
[y :type Bool :default true]) | ||
[x y])) | ||
|
||
(f :y 1 :x 2) | ||
(f :x 20 :y false) | ||
|
||
|
||
-- (record A | ||
-- [x :type Int :default (+ 1 2)] | ||
-- [y :type Bool :default true]) | ||
(define aa | ||
(seq | ||
(define x 1) | ||
(record A | ||
[x :type Int :default (+ x 2)] | ||
[y :type Bool]))) | ||
|
||
-- (A :x 10 :y false :z 12) | ||
(define x 10) | ||
(aa :y 20) |