{{
: :find ( a-af ) last repeat @ 2dup =if drop @ -1 ;; else dup 0 =if ;then then again ;
: .vocab ( a- ) dup 1+ @ :find nip if shut else open then ;
---reveal---
: as-vocab ( a- ) last @ d->class ['] .vocab swap ! ;
}}
First cleanup is to "as-vocab":
: as-vocab ( a- ) ['] .vocab reclass ;
Next, ".vocab":
: .vocab ( a- ) dup 1+ @ :find nip if shut ;then open ;
And then ":find":
: :find ( a-af ) last repeat @ 2dup =if drop @ TRUE ;then dup 0; drop again ;
{{
: :find ( a-af ) last repeat @ 2dup =if drop @ TRUE ;then dup 0; drop again ;
: .vocab ( a- ) dup 1+ @ :find nip if shut ;then open ;
---reveal---
: as-vocab ( a- ) ['] .vocab reclass ;
}}