Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
10
Task/Documentation/Phix/documentation.phix
Normal file
10
Task/Documentation/Phix/documentation.phix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
procedure StoreVar(integer N, integer NTyp)
|
||||
--
|
||||
-- Store a variable, applying any final operator as needed.
|
||||
-- If N is zero, PopFactor (ie store in a new temporary variable of
|
||||
-- the specified type). Otherwise N should be an index to symtab.
|
||||
-- If storeConst is 1, NTyp is ignored/overridden, otherwise it
|
||||
-- should usually be the declared or local type of N.
|
||||
--
|
||||
...
|
||||
end procedure
|
||||
|
|
@ -1,15 +1,28 @@
|
|||
doc{
|
||||
========
|
||||
Function: foo
|
||||
========
|
||||
# Determine The Average Word Name Length
|
||||
|
||||
Stack
|
||||
----
|
||||
a1 a2 - b
|
||||
To determine the average length of a word name two values
|
||||
are needed. First, the total length of all names in the
|
||||
Dictionary:
|
||||
|
||||
Usage
|
||||
-----
|
||||
Adds a1 to a2 returning b.
|
||||
}doc
|
||||
~~~
|
||||
#0 [ d:name s:length + ] d:for-each
|
||||
~~~
|
||||
|
||||
: foo ( aa-b ) + ;
|
||||
And then the number of words in the Dictionary:
|
||||
|
||||
~~~
|
||||
#0 [ drop n:inc ] d:for-each
|
||||
~~~
|
||||
|
||||
With these, a simple division is all that's left.
|
||||
|
||||
~~~
|
||||
/
|
||||
~~~
|
||||
|
||||
Finally, display the results:
|
||||
|
||||
|
||||
~~~
|
||||
'Average_name_length:_%n\n s:format s:put
|
||||
~~~
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue