Alpha Chen
1b0a2b3a7a
fix parsing bug w/no conditional in a for loop
2 years ago
Alpha Chen
963e123418
thx @tenderlove
2 years ago
Alpha Chen
8d43cd6157
14.challenges.2
2 years ago
Alpha Chen
1b50e1e3c5
move lines under chunk
2 years ago
Alpha Chen
d6577e5c4d
14.challenges.1
2 years ago
Alpha Chen
e9b4e8cbfd
14.6
2 years ago
Alpha Chen
93a074bda9
14.5.3
2 years ago
Alpha Chen
eed4628613
14.5.2
2 years ago
Alpha Chen
f8b030152e
14.4
2 years ago
Alpha Chen
56c2885565
14.3
2 years ago
Alpha Chen
71f19068a7
11.5.1
2 years ago
Alpha Chen
613c419b5c
11.5
2 years ago
Alpha Chen
1e16555963
11.4.3
2 years ago
Alpha Chen
1b3c8b6253
10.4.3
2 years ago
Alpha Chen
78f3d0ee76
10.4.2
2 years ago
Alpha Chen
32ba8bf6c3
10.4.1
2 years ago
Alpha Chen
bdb7d9f6c9
10.4.1 - environment
2 years ago
Alpha Chen
9140a71593
refactor resolver
2 years ago
Alpha Chen
02bea3faea
11.3.6
2 years ago
Alpha Chen
f9da923296
11.3.5
2 years ago
Alpha Chen
aa02e46d9f
11.3.4
2 years ago
Alpha Chen
6e6a79c84a
11.3.3
2 years ago
Alpha Chen
437a2b9633
11.3.2
2 years ago
Alpha Chen
97371d13be
11.3.1
2 years ago
Alpha Chen
0464eb1750
10.challenges.1
...
> 1. Our interpreter carefully checks that the number of arguments
passed to a function matches the number of parameters it expects. Since
this check is done at runtime on every call, it has a performance cost.
Smalltalk implementations don’t have that problem. Why not?
Because the arguments are part of the function signature.
2 years ago
Alpha Chen
b5bbfa6e48
10.6
2 years ago
Alpha Chen
fdacd541cb
10.5.1
2 years ago
Alpha Chen
264b30200c
10.5
2 years ago
Alpha Chen
91dc2b2c66
10.4.1
2 years ago
Alpha Chen
a944813d0d
10.4
2 years ago
Alpha Chen
b23936ade6
10.3
2 years ago
Alpha Chen
23c9bd5174
10.2.1
2 years ago
alpha
29d285dc45
10.1.4
...
FossilOrigin-Name: f49d9465e02a773fe8b1add8537291fd03620b1c6f14f3b0846a4aa4d362ee5f
2 years ago
alpha
355831dc29
10.1.2
...
FossilOrigin-Name: fae7fe1a493cd7d2c31e140204cfd581080c6bf5a70ed967107a1a5237bed129
2 years ago
alpha
c7504ddfe8
10.1.1
...
FossilOrigin-Name: c0a4d7dadf87d80ec3d0b6ef67e74d6c49d3ff2efa3179acf0ed90599b476efd
2 years ago
alpha
721546df59
10.1
...
FossilOrigin-Name: c1d35386c76ad60362ec68d9e94a6e4fe9cfc02c39b7c2589668a214a3f22c43
2 years ago
Alpha Chen
e2fbab63a7
set ruby-version to 3.1
2 years ago
alpha
b13eb90bdb
merge 10.1 work
...
FossilOrigin-Name: f3601e8f1a20360b1d0eb74e790601a4911d458705dd34ff4e25f7d4aba0a632
2 years ago
alpha
fe7e902211
10.1.4
...
FossilOrigin-Name: f49d9465e02a773fe8b1add8537291fd03620b1c6f14f3b0846a4aa4d362ee5f
2 years ago
alpha
28b9fd32d0
10.1.2
...
FossilOrigin-Name: fae7fe1a493cd7d2c31e140204cfd581080c6bf5a70ed967107a1a5237bed129
2 years ago
alpha
2a5230c925
10.1.1
...
FossilOrigin-Name: c0a4d7dadf87d80ec3d0b6ef67e74d6c49d3ff2efa3179acf0ed90599b476efd
2 years ago
alpha
4b48ef1a75
10.1
...
FossilOrigin-Name: c1d35386c76ad60362ec68d9e94a6e4fe9cfc02c39b7c2589668a214a3f22c43
2 years ago
alpha
d6f05497e3
9.challenges
...
> 1. A few chapters from now, when Lox supports first-class functions and dynamic
dispatch, we technically won’t need branching statements built into the
language. Show how conditional execution can be implemented in terms of those.
Name a language that uses this technique for its control flow.
Smalltalk? Lox doesn't have dictionaries, but in Ruby:
```ruby
def if_(cond, t, f)
{ true => t, false => f }[cond].()
end
```
> 2. Likewise, looping can be implemented using those same tools, provided our
interpreter supports an important optimization. What is it, and why is it
necessary? Name a language that uses this technique for iteration.
Tail recursion, Lisp?
FossilOrigin-Name: aec62b2632ecda95e950b0ea1a2cc7605db12f28cbbaf579f62519a4d5679aa4
2 years ago
alpha
66726f8e69
9.5.1
...
FossilOrigin-Name: e6003611fc9c7f22e8ab96c338f79c3f8a0ddd7ff15b21a37568b4b6c3f54329
2 years ago
alpha
8350af2632
9.4
...
FossilOrigin-Name: 58225e550ec53fff4dcdde3678d5850dd91a285ad4ab247baa1fbf71e8d73206
2 years ago
alpha
ce8c69136a
remove Visitable
...
FossilOrigin-Name: e45d353b7eddcab310ec5059d9ddc51a202526b145aa121d3c77815af59e43d1
2 years ago
alpha
cd50d4283e
9.3
...
FossilOrigin-Name: a8acba027eac65be97ac3bcd57fbdd71b177c922f1bc8c18deb9864de2a9da33
2 years ago
alpha
556e5e796c
9.2
...
FossilOrigin-Name: d0e9947d95fd8cad638edb04ff5d9d450516434320a54f6d478214d6e90800b5
2 years ago
alpha
42dd033fb4
add test for uninitialized vars
...
FossilOrigin-Name: 9b734dc92b4bca6a25fde30f556565d5a48a64f9a9531c89f2927f6674e82a70
2 years ago
alpha
e21f070968
8.challenges.1
...
FossilOrigin-Name: 4dd1670a4466cf079d61e11677e4aa8dd9b9ec096700e2ae565a4073ec4efc12
2 years ago