X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?p=clnl;a=blobdiff_plain;f=src%2Fmain%2Ftranspile.lisp;h=956b226eaea577f61fb3de51b4ac0417e8761a4d;hp=91af23a000d0d6208725416968e290ed5f98e19e;hb=807df6b;hpb=3ae0c35e27580b247652dff608dd8c4d29f16bff diff --git a/src/main/transpile.lisp b/src/main/transpile.lisp index 91af23a..956b226 100644 --- a/src/main/transpile.lisp +++ b/src/main/transpile.lisp @@ -196,9 +196,12 @@ DESCRIPTION: (defprim :if :command (lambda (pred a) `(when ,pred ,@(make-command-block-inline a)))) (defprim '(:ifelse :if-else) :command (lambda (pred a b) - `(if ,pred - ,@(make-command-block-inline a) - ,@(make-command-block-inline b)))) + (let + ((then (make-command-block-inline a)) + (else (make-command-block-inline b))) + `(if ,pred + ,@(if (= (length then) 1) then `((progn ,@then))) + ,@(if (= (length else) 1) else `((progn ,@else))))))) (defagentvalueprim :label) (defagentvalueprim :label-color)