From df5fa5f23909146ec9ddb15327158f248971b45a Mon Sep 17 00:00:00 2001 From: Daniel Ehrenberg Date: Sun, 30 Dec 2007 23:59:56 -0500 Subject: [PATCH] combinators.lib:construct-slots --- extra/combinators/lib/lib.factor | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extra/combinators/lib/lib.factor b/extra/combinators/lib/lib.factor index e4d66d4725..a24e7bd791 100644 --- a/extra/combinators/lib/lib.factor +++ b/extra/combinators/lib/lib.factor @@ -161,3 +161,8 @@ MACRO: map-call-with2 ( quots -- ) r> length [ narray ] curry append ; MACRO: map-exec-with ( words -- ) [ 1quotation ] map [ map-call-with ] curry ; + +MACRO: construct-slots ( assoc tuple-class -- tuple ) + [ construct-empty ] curry swap [ + [ dip ] curry swap 1quotation [ keep ] curry compose + ] { } assoc>map concat compose ;