make first2, first3, first4 inline

db4
Joe Groff 2009-10-26 17:30:37 -05:00
parent ab04d4479e
commit 5caa118e40
3 changed files with 4 additions and 7 deletions

View File

@ -78,9 +78,6 @@ SYNTAX: HINTS:
[ parse-definition { } like "specializer" set-word-prop ] tri ;
! Default specializers
{ first first2 first3 first4 }
[ { array } "specializer" set-word-prop ] each
{ last pop* pop } [
{ vector } "specializer" set-word-prop
] each

View File

@ -170,13 +170,13 @@ PRIVATE>
4 swap [ (4sequence) ] new-like ; inline
: first2 ( seq -- first second )
1 swap bounds-check nip first2-unsafe ; flushable
1 swap bounds-check nip first2-unsafe ; inline
: first3 ( seq -- first second third )
2 swap bounds-check nip first3-unsafe ; flushable
2 swap bounds-check nip first3-unsafe ; inline
: first4 ( seq -- first second third fourth )
3 swap bounds-check nip first4-unsafe ; flushable
3 swap bounds-check nip first4-unsafe ; inline
: ?nth ( n seq -- elt/f )
2dup bounds-check? [ nth-unsafe ] [ 2drop f ] if ; inline

View File

@ -20,7 +20,7 @@ M: matrix4 new-sequence 2drop matrix4 (struct) ; inline
<PRIVATE
: columns ( a -- a1 a2 a3 a4 )
columns>> 4 firstn ; inline
columns>> first4 ; inline
:: set-columns ( c1 c2 c3 c4 c -- c )
c columns>> :> columns