3125a52331/image/source/vocabs.retro

User picture

Commiter: Charles Childers

Author: Charles Childers

Revision: 3125a52331


File Size: 4.35 KB

(March 10, 2010 13:24 UTC) About 2 years ago

remove TRUE and FALSE; fix bugs in building; pristine image now core+stage2+vocabs

 
Show/hide line numbers
( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
( A vocab word is a word that can be used to open and shut a  )
( vocabulary section from the dictionary. It consists of      )
( three fields which point to three dictionary headers: the   )
( word before the vocabulary starts, the first word to be     )
( hidden, and the first word not to be hidden.                )
( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
{{
  3 elements shown hidden before
  create nest 24 allot
  variable depth
  : tod     (  -a  ) last @ ;
  : nod     (  -a  ) tod @ ;
  : current (  -a  ) shown @ ;
  : .shown  (  -a  ) current d->xt @ ;
  : .hidden (  -a  ) .shown 1+ ;
  : .before (  -a  ) .shown 1+ 1+ ;
  : after   ( a-a  ) last repeat @ 2dup @ =if nip ;then again ;
  : remove  ( a-   ) current dup @ swap after ! ;
  : replace ( a-   ) current tod over ! last ! ;
  : fields  (  -   ) shown .shown 3 copy ;
  : open    ( a-   ) @ shown ! .hidden @ .shown @ ! ;
  : shut    ( a-   ) @ shown ! .before @ .shown @ ! ;
  : :find   ( a-af ) last repeat @ 2dup =if drop @ -1 ;then dup 0; drop again ;
  : open?   ( a-af ) dup 1+ @ :find nip ;
  : toggle  ( a-   ) open? if shut ;then open ;
  : descend (  -   ) shown depth @ 3 * nest + 3 copy depth ++ ;
  : ascend  (  -   ) depth -- depth @ 3 * nest + shown 3 copy ;
  ---reveal---
  expose open expose shut
  : .vocab  ( a-   ) compiler @ if literal, then ` toggle ;
  : vocab   ( "-   ) create 3 allot ['] .vocab reclass ;
  : ((      (  -   ) descend tod shown ! nod before ! 0 hidden ! fields ;
  : ))      (  -   ) tod hidden ! fields remove replace ascend ;
}}


vocab retro
((
  expose include
  expose expose     expose >last
  expose elements   expose fastRender
  expose nexti      expose fori
  expose ifDefined  expose ifNotDefined
  expose eval       expose space
  expose does>      expose .does
  expose xt->d      expose .
  expose find       expose binary
  expose octal      expose hex
  expose decimal    expose ."
  expose within     expose rdrop
  expose r          expose pow
  expose <          expose >
  expose <>         expose =
  expose ahead
  expose else       expose ;then
  expose if;        expose if
  expose stub       expose `
  expose fill       expose copy
  expose zallot     expose allot
  expose constant   expose variable
  expose variable:  expose }}
  expose ---reveal---
  expose {{         expose }
  expose {          expose <list>
  expose --         expose ++
  expose char:      expose immediate
  expose compile-only
  expose .compiler  expose .primitive
  expose reclass:   expose reclass
  expose d'         expose forget

  expose base       expose whitespace
  expose which      expose heap
  expose #mem       expose fh
  expose fw         expose fb
  expose update     expose tib
  expose compiler   expose last
  expose (          expose next
  expose for        expose [']
  expose pop        expose push
  expose 0;         expose again
  expose repeat     expose then
  expose !if        expose <if
  expose >if        expose =if
  expose ;;         expose ;
  expose [          expose s"
  expose time
  expose ekey       expose key
  expose isNumber?  expose listen
  expose ok         expose >number
  expose save       expose notfound
  expose reset      expose depth
  expose boot       expose d->name
  expose d->xt      expose d->class
  expose .data      expose .macro
  expose .word      expose with-class
  expose remap-keys expose bye
  expose getLength  expose keepString
  expose redraw     expose tempString
  expose literal,   expose compile
  expose devector   expose is
  expose :devector  expose :is
  expose -!         expose +!
  expose !+         expose @+
  expose '          expose wait
  expose compare    expose "
  expose (.)        expose execute
  expose neg        expose mod
  expose /          expose off
  expose on         expose 2dup
  expose tuck       expose -rot
  expose rot        expose not
  expose 2drop      expose over
  expose clear      expose type
  expose emit       expose cr
  expose later      expose :
  expose create     expose ]
  expose ,          expose here
  expose accept     expose out
  expose in         expose dup
  expose nip        expose >>
  expose <<         expose /mod
  expose *          expose -
  expose +          expose !
  expose @          expose xor
  expose or         expose and
  expose drop       expose swap
  expose 1-         expose 1+
))