Paste: word 'user' not found in vocab
Author: | Sean Chapel |
Mode: | factor |
Date: | Fri, 17 Apr 2009 06:33:08 |
Plain Text |
USING: kernel ;
IN: factrak
TUPLE: user name position email ;
: <user> ( name position email -- user )
user boa ;
Author: | Sean Chapel |
Mode: | factor |
Date: | Fri, 17 Apr 2009 08:49:15 |
Plain Text |
USING: kernel io io.files io.encodings.utf8 prettyprint accessors sequences math.parser json.writer json.reader assocs ;
IN: factrak
TUPLE: user id name position email ;
: <user> ( name id position email -- user )
user boa ;
: userid>filename ( int -- string )
number>string "c:\\factrak\\data\\users\\" prepend ;
: user-add ( user -- )
dup id>> userid>filename utf8 [ json-print ] with-file-writer ;
: user-get ( int -- user )
userid>filename utf8 file-lines concat json>
values reverse [ ] each <user> ;
: make-test-data ( -- user )
1 "Sean Chapel" "Programmer" "me@gmail.com" <user> ;
New Annotation