[Jprogramming] Tacit adverb definitions?
Dan Bron
jf at dbron.net
Fri Jul 7 04:26:22 HKT 2006
Oleg wrote:
> Is there a precedent of such use of $: and : ?
Sure, it's used all the time to make monads invoke their dyadic counterpart with a useful default value.
require 'strings'
cut
' '&$: :([: -.&a: <;._2@,~)
'.' cut 'Sentences end in periods. Words in spaces.'
+------------------------+-----------------+
|Sentences end in periods| Words in spaces|
+------------------------+-----------------+
cut 'Sentences end in periods. Words in spaces.'
+---------+---+--+--------+-----+--+-------+
|Sentences|end|in|periods.|Words|in|spaces.|
+---------+---+--+--------+-----+--+-------+
require '~Phrases\phrc2.ijs'
v1
10&$: :^.
v2
10&^. :($:@] * ^.@(10"0) % ^.@[)
require 'dll'
XOR
$:/ :(22 b.)
It is also used in the dyad to invoke the monad, but I can't think of any standard examples at the moment, nor a useful pattern to search for. You can not use $: in the obverse to invoke the nominal (nor with .. .: D. nor within any other aspect of a verb).
-Dan
More information about the Programming
mailing list