Skip to content

Instantly share code, notes, and snippets.

@sogaiu
Created July 23, 2024 03:33
Show Gist options
  • Save sogaiu/8e082ff28fffa839990ed7b40673d905 to your computer and use it in GitHub Desktop.
Save sogaiu/8e082ff28fffa839990ed7b40673d905 to your computer and use it in GitHub Desktop.
literal bracket tuple as argument to function
$ janet
Janet 1.35.2-771956b5 linux/x64/gcc - '(doc)' for help
repl:1:> (disasm (fn [] (printf "%j" [:a])))
{:arity 0
:bytecode @[(ldc 0 0) (ldc 1 1) (push2 0 1) (ldc 0 2) (tcall 0)]
:constants @["%j" (:a) <cfunction printf>]
:defs @[]
:environments @[]
:max-arity 0
:min-arity 0
:slotcount 2
:source "repl"
:sourcemap @[(1 16) (1 16) (1 16) (1 16) (1 16)]
:structarg false
:vararg false}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment