mirror of
https://github.com/janet-lang/janet
synced 2025-10-18 01:07:40 +00:00
Modularize compiler.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
(loop [k :range [0 len]]
|
||||
(put tab (get s k) k))
|
||||
(loop [i :range [0 len], j :range [0 len]]
|
||||
(def k (get tab (- 0 (get s i) (get s j))))
|
||||
(when (and k (not= k i) (not= k j) (not= i j))
|
||||
(put solutions {i true j true k true} true)))
|
||||
(def k (get tab (- 0 (get s i) (get s j))))
|
||||
(when (and k (not= k i) (not= k j) (not= i j))
|
||||
(put solutions {i true j true k true} true)))
|
||||
(map keys (keys solution)))
|
||||
|
@@ -1,11 +1,10 @@
|
||||
# Example of dst bytecode assembly
|
||||
|
||||
# Fibonacci sequence, implemented with naive recursion.
|
||||
(def fibasm (asm.asm '{
|
||||
(def fibasm (asm '{
|
||||
arity 1
|
||||
bytecode [
|
||||
(ldi 1 0x2) # $1 = 2
|
||||
(lt 1 0 1) # $1 = $0 < $1
|
||||
(ltim 1 0 0x2) # $1 = $0 < 2
|
||||
(jmpif 1 :done) # if ($1) goto :done
|
||||
(lds 1) # $1 = self
|
||||
(addim 0 0 -0x1) # $0 = $0 - 1
|
||||
|
Reference in New Issue
Block a user