From e4edfe076d82c8b54dd51c8ac2831165aedef5dd Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 22 Dec 2008 05:50:43 -0600 Subject: [PATCH] Clean up ugly shuffling in documents code --- basis/documents/documents.factor | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/basis/documents/documents.factor b/basis/documents/documents.factor index 6993bcb65b..29f865cf3c 100644 --- a/basis/documents/documents.factor +++ b/basis/documents/documents.factor @@ -153,18 +153,18 @@ GENERIC: next-elt ( loc document elt -- newloc ) TUPLE: char-elt ; : (prev-char) ( loc document quot -- loc ) - -rot { - { [ over { 0 0 } = ] [ drop ] } - { [ over second zero? ] [ [ first 1- ] dip line-end ] } - [ pick call ] - } cond nip ; inline + { + { [ pick { 0 0 } = ] [ 2drop ] } + { [ pick second zero? ] [ drop [ first 1- ] dip line-end ] } + [ call ] + } cond ; inline : (next-char) ( loc document quot -- loc ) - -rot { - { [ 2dup doc-end = ] [ drop ] } - { [ 2dup line-end? ] [ drop first 1+ 0 2array ] } - [ pick call ] - } cond nip ; inline + { + { [ 2over doc-end = ] [ 2drop ] } + { [ 2over line-end? ] [ 2drop first 1+ 0 2array ] } + [ call ] + } cond ; inline M: char-elt prev-elt drop [ drop -1 +col ] (prev-char) ;