File:  [gforth] / gforth / vmgen-ex2 /
Revision 1.1: download - view: text, annotated - select for diffs
Sun Jun 2 15:46:17 2002 UTC (21 years, 6 months ago) by anton
Branches: MAIN
CVS tags: v0-7-0, v0-6-2, v0-6-1, v0-6-0, HEAD
vmgen-related changes:
in prims2x:
  Conversion macros for single items now take 2 arguments
  Converting from two items to a type has changed order
  argument printing for disassembler disabled (for now)
  disassembler now also uses VM_IS_INST
in Gforth and vmgen-ex: adapted to work with changed prims2x
new: vmgen-ex2: uses union for Cell instead of casting (lots of
   changes compared to vmgen-ex)

    1: func fib(n)
    2:   var r;
    3:   if n<2 then
    4:     r:=1;
    5:   else
    6:     r:=fib(n-1)+fib(n-2);
    7:   end if;
    8:   return r; 
    9:   // the language syntax (return only at end) leads to inefficient code here
   10: end func;
   12: func main()
   13:   return fib(34);
   14: end func;

FreeBSD-CVSweb <>