Paste: xbi

Author: dharmatech
Mode: factor
Date: Sat, 15 Nov 2008 14:12:05
Plain Text |
: consume-single ( quot -- quot )
  dup infer in>>
  {
    { [ dup 0 = ] [ drop [ drop ] prepose ] }
    { [ dup 1 = ] [ drop ] }
    { [ t       ] [ drop "consume-single: quotation consume 0 or 1." throw ] }
  }
  cond ;

: [xbi] ( a b -- quot ) [ consume-single ] bi@ [ bi ] curry curry ;

MACRO: xbi ( a b -- quot ) [xbi] ;

New Annotation

Summary:
Author:
Mode:
Body: