Paste: why can't I do x>>

Author: typemore
Mode: factor
Date: Thu, 19 Aug 2010 23:54:22
Plain Text |
USING: kernel math typed classes.struct locals ;
QUALIFIED-WITH: alien.c-types c

IN: sim 
       
STRUCT: svec
  { x c:double }
  { y c:double }
  { z c:double }
  { a c:double }
  { b c:double }
  { c c:double } ; 
  
:: s+ ( v1 : svec  v2 : svec -- c : svec )
  svec new
    v1 x>> v2 x>> + >>x
    v1 y>> v2 y>> + >>y
    v1 z>> v2 z>> + >>z
    v1 a>> v2 a>> + >>a
    v1 b>> v2 b>> + >>b
    v1 c>> v2 c>> + >>c
  ;
  

Annotation: without locals

Author: erg
Mode: factor
Date: Fri, 20 Aug 2010 00:01:44
Plain Text |
TYPED: s+ ( v1: svec  v2: svec -- c: svec )
    {
        [ [ x>> ] bi@ + ]
        [ [ y>> ] bi@ + ]
        [ [ z>> ] bi@ + ]
        [ [ a>> ] bi@ + ]
        [ [ b>> ] bi@ + ]
        [ [ c>> ] bi@ + ]
    } 2cleave svec <struct-boa> ;

New Annotation

Summary:
Author:
Mode:
Body: