-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #968 from arturo-lang/fix-evaluator-issues
[VM/eval] Fix pending issues, add unit-tests & cleanup
- Loading branch information
Showing
103 changed files
with
6,176 additions
and
2,051 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,6 +1,9 @@ | ||
3rd-party: | ||
- src/extras/* | ||
|
||
ast: | ||
- src/vm/ast.nim | ||
|
||
bytecode: | ||
- src/vm/bytecode.nim | ||
- src/vm/opcodes.nim | ||
|
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
the first 25 abundant odd numbers: | ||
945 => sum: 1920 | ||
1575 => sum: 3224 | ||
2205 => sum: 4446 | ||
2835 => sum: 5808 | ||
3465 => sum: 7488 | ||
4095 => sum: 8736 | ||
4725 => sum: 9920 | ||
5355 => sum: 11232 | ||
5775 => sum: 11904 | ||
5985 => sum: 12480 | ||
6435 => sum: 13104 | ||
6615 => sum: 13680 | ||
6825 => sum: 13888 | ||
7245 => sum: 14976 | ||
7425 => sum: 14880 | ||
7875 => sum: 16224 | ||
8085 => sum: 16416 | ||
8415 => sum: 16848 | ||
8505 => sum: 17472 | ||
8925 => sum: 17856 | ||
9135 => sum: 18720 | ||
9555 => sum: 19152 | ||
9765 => sum: 19968 | ||
10395 => sum: 23040 | ||
11025 => sum: 22971 | ||
the 1000th abundant odd number: 492975 => sum: 1012336 | ||
the first abundant odd number greater than one billion (10^9): 1000000575 => sum: 2083561584 |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
accost => cot acs | ||
accuse => cue acs | ||
afield => fed ail | ||
agleam => gem ala | ||
alcott => lot act | ||
allele => lee all | ||
allied => lid ale | ||
alpert => let apr | ||
ambient => min abet | ||
annette => net ante | ||
apport => pot apr | ||
ariadne => ran aide | ||
assist => sit ass | ||
battle => ate btl | ||
blaine => lie ban | ||
brenda => rna bed | ||
calliope => aloe clip | ||
choose => hoe cos | ||
choosy => hoy cos | ||
claire => lie car | ||
collude => old clue | ||
effete => fee eft | ||
fabric => arc fbi | ||
fealty => ely fat | ||
fluent => let fun | ||
forwent => own fret | ||
friend => red fin | ||
george => ere gog | ||
inroad => nod ira | ||
israel => sal ire | ||
jaunty => any jut | ||
joanne => one jan | ||
lounge => one lug | ||
oriole => roe oil | ||
oswald => sad owl | ||
parrot => art pro | ||
peoria => era poi | ||
pierre => ire per | ||
poodle => ode pol | ||
pounce => one puc | ||
racial => ail rca | ||
realty => ely rat | ||
sordid => odd sri | ||
spatial => pta sail | ||
sprain => pan sri | ||
strain => tan sri | ||
strait => tat sri | ||
sturdy => try sud | ||
sweaty => way set | ||
tattle => ate ttl | ||
theorem => hoe term | ||
though => huh tog | ||
throaty => hot tray | ||
triode => roe tid | ||
triune => rue tin | ||
troupe => rue top | ||
truant => rat tun | ||
twirly => wry til |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
2 3 5 7 13 17 19 23 29 37 | ||
47 59 67 79 89 127 137 139 149 157 | ||
167 179 239 257 269 347 349 359 367 379 | ||
389 457 467 479 569 1237 1249 1259 1279 1289 | ||
1367 1459 1489 1567 1579 1789 2347 2357 2389 2459 | ||
2467 2579 2689 2789 3457 3467 3469 4567 4679 4789 | ||
5689 12347 12379 12457 12479 12569 12589 12689 13457 13469 | ||
13567 13679 13789 15679 23459 23567 23689 23789 25679 34589 | ||
34679 123457 123479 124567 124679 125789 134789 145679 234589 235679 | ||
235789 245789 345679 345689 1234789 1235789 1245689 1456789 12356789 23456789 |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
First 20 brazilian numbers: | ||
7 8 10 12 13 14 15 16 18 20 21 22 24 26 27 28 30 31 32 33 | ||
|
||
First 20 odd brazilian numbers: | ||
7 13 15 21 27 31 33 35 39 43 45 51 55 57 63 65 69 73 75 77 | ||
|
||
First 20 prime brazilian numbers: | ||
7 13 31 43 73 127 157 211 241 307 421 463 601 757 1093 1123 1483 1723 2551 2801 |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
analyses => analysis | ||
atlantes => atlantis | ||
bellow => billow | ||
breton => briton | ||
clench => clinch | ||
convect => convict | ||
crises => crisis | ||
diagnoses => diagnosis | ||
enfant => infant | ||
enquiry => inquiry | ||
frances => francis | ||
galatea => galatia | ||
harden => hardin | ||
heckman => hickman | ||
inequity => iniquity | ||
inflect => inflict | ||
jacobean => jacobian | ||
marten => martin | ||
module => moduli | ||
pegging => pigging | ||
psychoses => psychosis | ||
rabbet => rabbit | ||
sterling => stirling | ||
synopses => synopsis | ||
vector => victor | ||
welles => willis |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
aristotelean - aristotelian | ||
claustrophobia - claustrophobic | ||
committeeman - committeemen | ||
committeewoman - committeewomen | ||
complementary - complimentary | ||
confirmation - conformation | ||
congresswoman - congresswomen | ||
councilwoman - councilwomen | ||
craftsperson - draftsperson | ||
eavesdropped - eavesdropper | ||
frontiersman - frontiersmen | ||
handicraftsman - handicraftsmen | ||
incommutable - incomputable | ||
installation - instillation | ||
kaleidescope - kaleidoscope | ||
neuroanatomy - neuroanotomy | ||
newspaperman - newspapermen | ||
nonagenarian - nonogenarian | ||
onomatopoeia - onomatopoeic | ||
philanthrope - philanthropy | ||
prescription - proscription | ||
schizophrenia - schizophrenic | ||
shakespearean - shakespearian | ||
spectroscope - spectroscopy | ||
underclassman - underclassmen | ||
upperclassman - upperclassmen |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
2 | ||
3 | ||
5 | ||
7 | ||
11 | ||
13 | ||
17 | ||
37 | ||
79 | ||
113 | ||
197 | ||
199 | ||
337 | ||
1193 | ||
3779 | ||
11939 | ||
19937 | ||
193939 | ||
199933 |
3 changes: 1 addition & 2 deletions
3
...omposite numbers k with no single digit factors whose factors are all substrings of k.art
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
242 | ||
13398445413854501 |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
2 3 5 7 31 41 43 53 61 71 | ||
73 83 97 421 431 521 541 631 641 643 | ||
653 743 751 761 821 853 863 941 953 971 | ||
983 5431 6421 6521 7321 7541 7621 7643 8431 8521 | ||
8543 8641 8731 8741 8753 8761 9421 9431 9521 9631 | ||
9643 9721 9743 9851 9871 75431 76421 76541 76543 86531 | ||
87421 87541 87631 87641 87643 94321 96431 97651 98321 98543 | ||
98621 98641 98731 764321 865321 876431 975421 986543 987541 987631 | ||
8764321 8765321 9754321 9875321 97654321 98764321 98765431 |
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,2 +1,3 @@ | ||
try? -> 3/0 | ||
a: 0 | ||
try? -> 3 / a | ||
else -> print "division by zero" |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
The first 20 emirps: | ||
13 17 31 37 71 73 79 97 107 113 149 157 167 179 199 311 337 347 359 389 | ||
|
||
Emirps between 7700 and 8000: | ||
7717 7757 7817 7841 7867 7879 7901 7927 7949 7951 7963 | ||
|
||
The 10000th emirp: | ||
948349 |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Base 9 factorions: [1 2 41282] | ||
Base 10 factorions: [1 2 145 40585] | ||
Base 11 factorions: [1 2 26 48 40472] | ||
Base 12 factorions: [1 2] |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Fibonacci of 1 = 1 | ||
Fibonacci of 2 = 2 | ||
Fibonacci of 3 = 3 | ||
Fibonacci of 4 = 5 | ||
Fibonacci of 5 = 8 | ||
Fibonacci of 6 = 13 | ||
Fibonacci of 7 = 21 | ||
Fibonacci of 8 = 34 | ||
Fibonacci of 9 = 55 | ||
Fibonacci of 10 = 89 | ||
Fibonacci of 11 = 144 | ||
Fibonacci of 12 = 233 | ||
Fibonacci of 13 = 377 | ||
Fibonacci of 14 = 610 | ||
Fibonacci of 15 = 987 | ||
Fibonacci of 16 = 1597 | ||
Fibonacci of 17 = 2584 | ||
Fibonacci of 18 = 4181 | ||
Fibonacci of 19 = 6765 | ||
Fibonacci of 20 = 10946 | ||
Fibonacci of 21 = 17711 | ||
Fibonacci of 22 = 28657 | ||
Fibonacci of 23 = 46368 | ||
Fibonacci of 24 = 75025 | ||
Fibonacci of 25 = 121393 |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Hailstone sequence for 27: | ||
27 82 41 124 62 31 94 47 142 71 214 107 322 161 484 242 121 364 182 91 274 137 412 206 103 310 155 466 233 700 350 175 526 263 790 395 1186 593 1780 890 445 1336 668 334 167 502 251 754 377 1132 566 283 850 425 1276 638 319 958 479 1438 719 2158 1079 3238 1619 4858 2429 7288 3644 1822 911 2734 1367 4102 2051 6154 3077 9232 4616 2308 1154 577 1732 866 433 1300 650 325 976 488 244 122 61 184 92 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1 | ||
max hailstone sequence found (<100000): of length 179 for 871 |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
1 2 3 4 5 6 8 9 10 12 15 16 18 20 24 25 27 30 32 36 | ||
2125764000 | ||
519312780448388736089589843750000000000000000000000000000000000000000000000000000000 |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
998764543431 | ||
6054854654 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
9867312 |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The first 25 ludic numbers: | ||
1 2 3 5 7 11 13 17 23 25 29 37 41 43 47 53 61 67 71 77 83 89 91 97 107 | ||
|
||
There are 142 ludic numbers less than/or equal to 1000 | ||
|
||
The ludic numbers from 2000th to 2005th are: [21475 21481 21487 21493 21503 21511] | ||
|
||
The triplets of ludic numbers less than 250 are: | ||
[1 3 7] [5 7 11] [11 13 17] [23 25 29] [41 43 47] [173 175 179] [221 223 227] [233 235 239] |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
The first 20 magic constants are: | ||
15 34 65 111 175 260 369 505 671 870 1105 1379 1695 2056 2465 2925 3439 4010 4641 | ||
|
||
The 1,000th magic constant is: | ||
503006505 | ||
|
||
10 ^ 1 => 3 | ||
10 ^ 2 => 6 | ||
10 ^ 3 => 13 | ||
10 ^ 4 => 28 | ||
10 ^ 5 => 59 | ||
10 ^ 6 => 126 | ||
10 ^ 7 => 272 | ||
10 ^ 8 => 585 | ||
10 ^ 9 => 1260 | ||
10 ^ 10 => 2715 | ||
10 ^ 11 => 5849 | ||
10 ^ 12 => 12600 | ||
10 ^ 13 => 27145 | ||
10 ^ 14 => 58481 | ||
10 ^ 15 => 125993 | ||
10 ^ 16 => 271442 | ||
10 ^ 17 => 584804 | ||
10 ^ 18 => 1259922 | ||
10 ^ 19 => 2714418 |
Oops, something went wrong.