From 9ddb43a30f817d27d9ade1517728c759c43f8541 Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Sun, 14 Jul 2024 14:28:09 -0400 Subject: [PATCH] called keywords work in pipelines --- src/interpreter.janet | 7 ++++--- src/ludus.janet | 7 +++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/interpreter.janet b/src/interpreter.janet index 5858706..a252b99 100644 --- a/src/interpreter.janet +++ b/src/interpreter.janet @@ -460,6 +460,7 @@ [:function :tuple] (call-fn root-ast prev curr) # [:applied :tuple] (call-partial root-ast prev curr) [:keyword :args] (get (first curr) prev :^nil) + [:keyword :tuple] (get (first curr) prev :^nil) [:dict :keyword] (get prev curr :^nil) [:nil :keyword] :^nil [:pkg :keyword] (get prev curr :^nil) @@ -473,7 +474,7 @@ # (pp terms) (def first-term (first terms)) (def last-term (last terms)) - (var prev (interpret first-term ctx)) + (var prev (interpret first-term ctx)) # (print "root term: ") # (pp prev) (for i 1 (-> terms length dec) @@ -489,9 +490,9 @@ (def last-term (last terms)) (for i 1 (-> terms length dec) (def curr (interpret (terms i) ctx)) - (set prev (call-fn (first terms) curr [prev]))) + (set prev (apply-synth-term (first terms) curr [prev]))) (def last-fn (interpret last-term ctx)) - (call-fn (first terms) last-fn [prev])) + (apply-synth-term (first terms) last-fn [prev])) (defn- pkg [ast ctx] (def members (ast :data)) diff --git a/src/ludus.janet b/src/ludus.janet index 856f2cc..a08ebcd 100644 --- a/src/ludus.janet +++ b/src/ludus.janet @@ -53,21 +53,20 @@ (comment # (do - (def start (os/clock)) + # (def start (os/clock)) (def source ` -at ("aéc", 3) `) (def out (-> source ludus j/decode )) - (def end (os/clock)) + # (def end (os/clock)) (setdyn :out stdout) (pp out) (def console (out "console")) (print console) (def result (out "result")) (print result) - (print (- end start)) + # (print (- end start)) )