JoeStrout / miniscript

source code of both C# and C++ implementations of the MiniScript scripting language
MIT License
280 stars 64 forks source link

list all native functions #168

Closed badiku closed 3 months ago

badiku commented 3 months ago

not mentioned in manual , is there a command to list all native functions in commandline miniscript.exe

badiku commented 3 months ago

update: just find this useful undocumented command: intrinsics

> intrinsics
{"code": FUNCTION(self), "intrinsics": FUNCTION(), "remove": FUNCTION(self, k), "ceil": FUNCTION(x=0)
, "indexes": FUNCTION(self), "pi": FUNCTION(), "sort": FUNCTION(self=0, byKey, ascending=1)
, "sign": FUNCTION(x=0), "pop": FUNCTION(self), "replace": FUNCTION(self, oldval, newval, maxCount)
, "cos": FUNCTION(radians=0), "round": FUNCTION(x=0, decimalPlaces=0), "version": FUNCTION()
, "_dateVal": FUNCTION(dateStr), "refEquals": FUNCTION(a, b), "input": FUNCTION(prompt="")
, "yield": FUNCTION(), "list": FUNCTION(), "push": FUNCTION(self, value), "bitXor": FUNCTION(i=0, j=0)
, "time": FUNCTION(), "upper": FUNCTION(self), "bitOr": FUNCTION(i=0, j=0), "hasIndex": FUNCTION(self, index)
, "split": FUNCTION(self, delimiter=" ", maxCount=-1), "abs": FUNCTION(x=0), "import": FUNCTION(libname="")
, "log": FUNCTION(x, base=10), "env": FUNCTION(), "char": FUNCTION(codePoint=65), "hash": FUNCTION(obj)
, "sin": FUNCTION(radians=0), "range": FUNCTION(from=0, to=0, step), "_dateStr": FUNCTION(date, format="yyyy-MM-dd HH:mm:ss")
, "pull": FUNCTION(self), "acos": FUNCTION(x=0), "shuffle": FUNCTION(self), "indexOf": FUNCTION(self, value, after)
, "number": FUNCTION(), "sum": FUNCTION(self), "map": FUNCTION(), "stackTrace": FUNCTION(), "join": FUNCTION(self, delimiter=" ")
, "values": FUNCTION(self), "print": FUNCTION(s="", delimiter="
"), "atan": FUNCTION(y=0, x=1), "funcRef": FUNCTION(), "exit": FUNCTION(resultCode), "bitAnd": FUNCTION(i=0, j=0)
, "slice": FUNCTION(seq, from=0, to), "shellArgs": FUNCTION(), "val": FUNCTION(self=0), "str": FUNCTION(x=0), "lower": FUNCTION(self)
, "len": FUNCTION(self), "string": FUNCTION(), "tan": FUNCTION(radians=0), "rnd": FUNCTION(seed), "sqrt": FUNCTION(x=0)
, "wait": FUNCTION(seconds=1), "file": FUNCTION(), "insert": FUNCTION(self, index, value)
, "exec": FUNCTION(cmd, timeout=30), "floor": FUNCTION(x=0), "asin": FUNCTION(x=0)}

any other such useful command?

JoeStrout commented 3 months ago

Updating the manual is already on the to-do list. Till then, please refer to the release notes and the wiki. (And if you find something missing from the wiki, please pitch in and add it.)