add a little commentary on does

FossilOrigin-Name: 79c8127fb44594ca2dd97da51fca9dfa7908d6b8905bd2742aeb8e79eab4325b
This commit is contained in:
crc 2017-10-25 01:10:58 +00:00
parent c14797cccf
commit 1837e71bc2

View file

@ -532,8 +532,8 @@ workable approach.
Temporary strings are allocated in a circular pool (at STRINGS).
~~~
:TempStrings ; &class:data reclass #32 !TempStrings
:TempStringMax ; &class:data reclass #512 !TempStringMax
:TempStrings ; data #32 !TempStrings
:TempStringMax ; data #512 !TempStringMax
:STRINGS EOM @TempStrings @TempStringMax * - ;
{{
@ -694,6 +694,9 @@ Copy a string, including the terminator.
:s:copy (ss-) over s:length n:inc copy ;
~~~
RETRO provides string constants for several ranges of characters that
are of some general interest.
~~~
:s:DIGITS (-s) '0123456789 ;
:s:ASCII-LOWERCASE (-s) 'abcdefghijklmnopqrstuvwxyz ;
@ -911,8 +914,12 @@ Rather than using a lot of shufflers, `reorder` simplfies this into:
}}
~~~
I need to describe these and provide some examples of where they are
useful.
`does` is intended to be paired with `d:create` to attach an action to a
newwly created data structure. An example use might be something like:
:constant (ns-) d:create , [ fetch ] does ;
In a traditional Forth this is similar in spirit to DOES>.
~~~
:curry (vp-p) here [ swap compile:lit compile:call compile:ret ] dip ;