1 \ examples from FORML conference paper Nov 98
4 \ $FreeBSD: src/sys/boot/ficl/softwords/forml.fr,v 1.1 2002/04/09 17:45:27 dcs Exp $
5 \ $DragonFly: src/sys/boot/ficl/softwords/forml.fr,v 1.1 2003/11/10 06:08:34 dillon Exp $
7 .( loading FORML examples ) cr
8 object --> sub c-example
11 4 c-4byte array: .quad
15 : init ( inst class -- )
17 s" aardvark" 2swap --> set-name
20 : get-name ( inst class -- c-addr u )
22 --> .name -rot ( c-addr inst class )
26 : set-name { c-addr u 2:this -- }
27 u this --> .length --> set
28 c-addr this --> .name u move
31 : ? ( inst class ) c-example => get-name type cr ;
35 : test ." this is a test" cr ;
37 c-word --> ref testref
39 \ add a method to c-word...
40 c-word --> get-wid ficl-set-current
41 \ list dictionary thread
44 2dup --> get-name type cr
54 : on { led# 2:this -- }
55 this --> .state --> get
56 1 led# lshift or dup !oreg
57 this --> .state --> set
60 : off { led# 2:this -- }
61 this --> .state --> get
62 1 led# lshift invert and dup !oreg
63 this --> .state --> set
69 object subclass c-switch
71 : ?on { bit# 2:this -- flag }