[Jprogramming] All hooks?

Arie Groeneveld bradypus at xs4all.nl
Thu Oct 11 22:32:42 HKT 2007


Just an experience.

Suppose I want to replace negative values of y
with a zero:
 
a)   (0<:y)*y

or

b)   y*(0<:y)

I can replace them with one of the following:

1)   b --> (*0<:]) y    
2)   b --> (*0&<:) y
3)   a --> (0&<:*]) y

questions:

i.  should I prefer no. 2 (as I do BTW),
f.e. in a way of elegance, more tacit ?

ii. 2 and 3 are hooks: dyadic 0<:y becomes monadic 0&<:y
so I have (f g) y   <==>  y f g y
I interpret no. 1 also as a (nested?) hook, right?
IOW  (f m g h) y <==> (f G) y <==> y f G y
     <==> y f (m (g h) y) <==> y f (m g h y)
     <==> y f m g h y


Thanks

+---+----------+
|@@i|a.{~q:9991|
+---+----------+




More information about the Programming mailing list