Find: Difference between revisions

414 bytes added ,  1 year ago
"Better category ordering, add redirects to categories, fix pseudo-adverb categories"
(add find page)
 
("Better category ordering, add redirects to categories, fix pseudo-adverb categories")
 
(7 intermediate revisions by 2 users not shown)
Line 1:
{{primitive|x&?y}}
 
The '''find''' primitive is used to find the index of an atom <code>y</code> in array <code>x</code>. It returns <code>0N</code> if the element is not found.
Line 11:
0N 1 0N 0
</pre>
For dictionaries, returns the keys associated with the given values:
<pre>
(`a`b`c`d!23 14 9 5)?9 14
`c`b
</pre>
 
== K3 ==
 
In K3, Find is [[atomicity|non-atomic.]] It considers <code>y</code> as a single unit, and will return a single index for it. <code>?/:</code> is needed to simulate the functionality of later Ks.
 
[[Category:Verbs]]
[[Category:Named verbs]]
[[Category:Operator verbs]]
[[Category:Primitives]]
720

edits