From 0ad2c54f55145335f5b458ccaa3324fc205e2390 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 27 Jun 2016 20:23:28 -0700 Subject: [PATCH] modern: Fix arity for paths. --- collections/sequences/extras/extras-tests.factor | 2 +- core/modern/out/out.factor | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/collections/sequences/extras/extras-tests.factor b/collections/sequences/extras/extras-tests.factor index 9df9c0aec7..0637bd74b3 100644 --- a/collections/sequences/extras/extras-tests.factor +++ b/collections/sequences/extras/extras-tests.factor @@ -259,4 +259,4 @@ IN: sequences.extras.tests [ 3 { 1 1 2 1 1 1 } [ 2 = not ] head-nth-match ] unit-test { { 1 1 2 1 } { 1 1 } } -[ 3 { 1 1 2 1 1 1 } [ 2 = not ] cut-nth-match ] unit-test \ No newline at end of file +[ 3 { 1 1 2 1 1 1 } [ 2 = not ] cut-nth-match ] unit-test diff --git a/core/modern/out/out.factor b/core/modern/out/out.factor index 7a7c90d58f..a19a499bf4 100644 --- a/core/modern/out/out.factor +++ b/core/modern/out/out.factor @@ -233,10 +233,6 @@ M: compound-sequence-literal write-literal call ] if ; inline recursive -: rewrite-path ( path quot -- ) - ! dup print - $[ [ path>literals [ _ map-literals ] map ] [ ] bi write-modern-path ] - [ drop . ] recover ; inline GENERIC: split-arity ( obj -- seq ) ; @@ -254,6 +250,17 @@ M: less-than-literal split-arity M: object split-arity ; + +: rewrite-path ( path quot -- ) + ! dup print + $[ + [ + path>literals + [ _ map-literals ] map + [ split-arity ] map + ] [ ] bi write-modern-path ] + [ drop . ] recover ; inline + : rewrite-string ( string quot -- ) ! dup print [ string>literals ] dip $[ _ map-literals ] map