File tree Expand file tree Collapse file tree 3 files changed +17
-19
lines changed Expand file tree Collapse file tree 3 files changed +17
-19
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ fn getFibonacci(n: i64) i64 {
34
34
title : 'fixed point' ,
35
35
code : `use core::panic;
36
36
pub fn main() i64 {
37
- let g = |f: |i64| => i64 , x: i64 | => i64 {
37
+ let g = |f, x| => {
38
38
if x == 0 {
39
39
return 1;
40
40
}
@@ -59,19 +59,16 @@ impl<A|F> Func<A|F> {
59
59
}
60
60
61
61
fn Y<A|R>(g: ||A| => R, A| => R) |A| => R {
62
- return |x: A | => R {
63
- let in = |f: Func<A|R> , x: A | => R {
62
+ return |x| => {
63
+ return |f , x| => {
64
64
return f.call(f, x);
65
- };
66
- let field = |f: Func<A|R>, x: A| => R {
67
- return g(|x: A| => R {
68
- return f.call(f, x);
69
- }, x);
70
- };
71
- let f = Func{
72
- f: field
73
- };
74
- return in(f, x);
65
+ }(Func{
66
+ f: |f, x| => {
67
+ return g(|x| => {
68
+ return f.call(f, x);
69
+ }, x);
70
+ }
71
+ }, x);
75
72
};
76
73
}
77
74
@@ -82,6 +79,7 @@ fn fact_recursion(x: i64) i64 {
82
79
return x * fact_recursion(x - 1);
83
80
}
84
81
82
+
85
83
` ,
86
84
} ,
87
85
{
@@ -139,7 +137,7 @@ use core::panic::assert;
139
137
use core::eq::*;
140
138
141
139
fn main() i64 {
142
- let table = hashtable::new_hash_table<string|string> (10 as u64, 1 as u64);
140
+ let table = hashtable::new_hash_table(10 as u64, 1 as u64);
143
141
table.insert("hello","world");
144
142
table.insert("bye","bye");
145
143
assert(table.get("hello") is string);
Original file line number Diff line number Diff line change 31
31
"registry" : " https://registry.npmjs.org/"
32
32
},
33
33
"dependencies" : {
34
- "@pivot-lang/pivot-lang" : " 0.1.2-be67dea .0" ,
34
+ "@pivot-lang/pivot-lang" : " 0.1.2-ed16221 .0" ,
35
35
"monaco-editor" : " ^0.37.1" ,
36
36
"monaco-themes" : " ^0.4.4" ,
37
37
"vscode-languageserver-types" : " ^3.17.3"
You can’t perform that action at this time.
0 commit comments