From: Doug Coleman Date: Fri, 29 Jul 2022 21:30:01 +0000 (-0500) Subject: kernel: Add withd X-Git-Tag: 0.99~1283 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=222202d7e1aee3de4a3509f17742893100c41cf7 kernel: Add withd 10 { { 1 100 } { 2 200 } { 3 300 } } [ + + . ] withd assoc-each Quotation sees: 10 1 100 10 2 200 10 3 300 --- diff --git a/core/kernel/kernel.factor b/core/kernel/kernel.factor index 82e8553f5f..ce9c8381cb 100644 --- a/core/kernel/kernel.factor +++ b/core/kernel/kernel.factor @@ -236,6 +236,9 @@ DEFER: if : 2with ( param1 param2 obj quot -- obj curried ) with with ; inline +: withd ( param obj quot -- obj curried ) + swapd [ -rotd call ] 2curry ; inline + : prepose ( quot1 quot2 -- composed ) swap compose ; inline