streamlined q-form related calls

This commit is contained in:
Luxferre
2026-07-04 16:59:38 +03:00
parent 46ff217e14
commit a4978499d6
5 changed files with 25 additions and 25 deletions
+2 -2
View File
@@ -468,7 +468,7 @@ func NewClyx(libfname string, libCode string) *Clyx {
c.words["loop"] = func() { body, cond := c.pop().([]any), c.pop().([]any); for { c.execQForm(cond); if !isTruthy(c.pop()) { break }; c.execQForm(body) } }
c.words["hsargs"] = func() { c.stack = append(c.stack, toAnySlice(os.Args)) }
c.words["hsexit"] = func() { os.Exit(int(toInt(c.pop()))) }
c.words["l2s"] = func() {
c.words["q2s"] = func() {
l := c.pop().([]any)
var sb strings.Builder
for _, val := range l {
@@ -512,7 +512,7 @@ func NewClyx(libfname string, libCode string) *Clyx {
regMath("exp", math.Exp)
regMath("log", math.Log)
c.Run(`"::" [ next defw ] defw :: readf [ "r" fopen dup read swap close ] :: src [ readf l2s i ]`)
c.Run(`"::" [ next defw ] defw :: readf [ "r" fopen dup read swap close ] :: src [ readf q2s i ]`)
if libfname == "" {
c.Run(libCode)