Paste: binary function to pair function

Author: Rory Molinari
Mode: factor
Date: Sat, 7 May 2022 01:08:41
Plain Text |
USING: kernel sequences ;
IN: trial

: wrap ( f: ( a b -- n ) -- f' ) [ first2 ] swap compose ;
: foo ( f: ( a b -- n ) -- n ) wrap { 1 2 } swap call ;

Annotation: Annotation

Author: Rory Molinari
Mode: factor
Date: Sat, 7 May 2022 01:32:13
Plain Text |
So, I misunderstood the instructions in the factor documentation. I need to annotate the call in foo:


: foo ( f: ( a b -- n ) -- n ) wrap { 1 2 } swap call( seq -- n ) ;

New Annotation

Summary:
Author:
Mode:
Body: