Paste: calling problem

Author: Twinside
Mode: factor
Date: Sat, 10 Apr 2010 09:32:06
Plain Text |
TUPLE: line x1 y1 x2 y2 ;
C: <line> line

GENERIC: pointlist> ( object -- seq )
GENERIC# >pointlist 1 ( obj seq -- obj )

M: line pointlist>
    [ [ x1>> ] [ y1>> ] bi 2array ] keep
    [ x2>> ] [ y2>> ] bi 2array
    2array
    ;

M: line >pointlist
    ! OBJ
    ! { { x1 y1 } { x2 y2 } }
    { { [ >>x1 ] [ >>y1 ] }
      { [ >>x2 ] [ >>y2 ] } }
    [ [ call ] 2each ] 2each 
    ; inline

! resource:work/svgcreator/svgcreator.factor: 46
!
!  Asset: M\ line >pointlist
! 
! Cannot apply “call” to a run-time computed value
! macro call

New Annotation

Summary:
Author:
Mode:
Body: