mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-10 21:58:48 +01:00
This allows "%(...)" inside a string literal to interpolate the stringified result of an expression. It doesn't support custom interpolators or format strings, but we can consider extending that later.
13 lines
218 B
Plaintext
13 lines
218 B
Plaintext
class Fib {
|
|
static get(n) {
|
|
if (n < 2) return n
|
|
return get(n - 1) + get(n - 2)
|
|
}
|
|
}
|
|
|
|
var start = System.clock
|
|
for (i in 1..5) {
|
|
System.print(Fib.get(28))
|
|
}
|
|
System.print("elapsed: %(System.clock - start)")
|