all repos — min @ 5fc39730327cc89614af2992a7f95392e9ad5f63

A small but practical concatenative programming language.

added `shl` and `shr` + code cleanup (indentation fix)
drkameleon yaniszaf@gmail.com
Thu, 21 Jan 2021 13:59:29 +0100
commit

5fc39730327cc89614af2992a7f95392e9ad5f63

parent

9ebe93854ff2dfe6db78559f59d65765b94a000e

1 files changed, 20 insertions(+), 6 deletions(-)

jump to
M minpkg/lib/min_binary.nimminpkg/lib/min_binary.nim

@@ -28,11 +28,25 @@ let a = vals[1]

i.push newVal(a.intVal or b.intVal) - def.symbol("bitxor") do (i: In): - let vals = i.expect("int","int") - let b = vals[0] - let a = vals[1] - - i.push newVal(a.intVal xor b.intVal) + def.symbol("bitxor") do (i: In): + let vals = i.expect("int","int") + let b = vals[0] + let a = vals[1] + + i.push newVal(a.intVal xor b.intVal) + + def.symbol("shl") do (i: In): + let vals = i.expect("int","int") + let b = vals[0] + let a = vals[1] + + i.push newVal(a.intVal shl b.intVal) + + def.symbol("shr") do (i: In): + let vals = i.expect("int","int") + let b = vals[0] + let a = vals[1] + + i.push newVal(a.intVal shr b.intVal) def.finalize("binary")