cl-interpret: Give the interpreter a little love

And stop copying strings around.
This commit is contained in:
2024-04-19 10:49:25 -05:00
parent 90a3818ca0
commit 9dc0cc7841
5 changed files with 139 additions and 65 deletions

View File

@@ -1,11 +1,11 @@
// FizzBuzz, using the unstable variadic-`print` builtin
fn main() {
fizz_buzz(10, 20)
fizzbuzz(10, 20)
}
// Outputs FizzBuzz for numbers between `start` and `end`, inclusive
fn fizz_buzz(start: i128, end: i128) {
fn fizzbuzz(start: i128, end: i128) {
for x in start..=end {
print(if x % 15 == 0 {
"FizzBuzz"