dictionary page for f. mentions "problems" with f. when u includes $:
this example seems ok though:
+ 1 : ' 0 & $: : (u/ % #) f.'
0&$: :(+/ % #)
cut f.
' '&$: :([: -.&a: <;._2@,~)
but:
, 1 : ' u@cut f.'
,@(' '&$: :([: -.&a: <;._2@,~) (1 : 0))
u y
:
x u y
)
adds some "explicit boilerpl
Just to follow up that this limitation/feature of f. is a necessary one. When
using $: as recursion (potential multiple repeats) limiting its scope to just
its (named) self is or at least feels like a prudent way to avoid recursion
errors. Errors that are more painful than most since infinite
What if its scope were delineated explicitly?
-E
On Wed, 9 Feb 2022, 'Pascal Jasmin' via Programming wrote:
Just to follow up that this limitation/feature of f. is a necessary one. When using $:
as recursion (potential multiple repeats) limiting its scope to just its (named) self is
or at
on the bind conjunction proposal, one huge benefit of it would be the apply
verb.
'[ + +/@]'& apply 1 2 3
7 8 9 NB. 1 2 3 + 6 because [ monadically is same as ]
if we've used apply, we've all tried this:
2 '[ + +/@]'& apply 1 2 3
31 32 33
which executes '+/'& apply(^:2) 1 2 3
so:
b=: &
Jose/Pepe has done this. afaiu I think it is a way to avoid unnecessary
intermediate names.
I can't say I understand how adding 1: 0 to the f. result changes how $:
applying to its entire new verb phrase "complications" gets avoided in any way.
, 1 : ' u@cut f.'
On Wednesday, February 9
On Wed, 9 Feb 2022, 'Pascal Jasmin' via Programming wrote:
Jose/Pepe has done this. afaiu I think it is a way to avoid unnecessary
intermediate names.
I was going to ask: how? But then I realised it is completely possible to
define this as-is:
recur=: 13!:8@21
scope=: {{
old_recur=. recu
On Wed, Feb 9, 2022 at 2:04 PM 'Pascal Jasmin' via Programming
wrote:
> I can't say I understand how adding 1: 0 to the f. result changes how $:
> applying to its entire new verb phrase "complications" gets avoided in any
> way.
>
> , 1 : ' u@cut f.'
It's not avoided -- $: represents the entire
Thank you Raul for an example of differences.
The biggest mystery to me is how adding the 1 : 0 multiline boilerplate is
different from adding ]:/1 :'u' adverb or no adverb at all.
hmmm... actualy what the explicit code does is ensure that expression results
in a verb, and will not result in
On Wed, Feb 9, 2022 at 3:29 PM 'Pascal Jasmin' via Programming
wrote:
> The biggest mystery to me is how adding the 1 : 0 multiline boilerplate is
> different from adding ]:/1 :'u' adverb or no adverb at all.
The difference between 1 :'u' and 1 :('u y';':';'x u y') is similar to
the difference
there doesn't seem to be a difference between
<@cut f. 1 :'u ' 'a b c'
<@cut f. 1 :'u y' 'a b c'
<@cut f. and <@(cut f.) do differ in their representations, with the first
getting the 1 : 0 boilerplate.
There is an extra boxing level result for 2nd. without f., first result occurs
which woul
On Wed, Feb 9, 2022 at 4:13 PM 'Pascal Jasmin' via Programming
wrote:
> there doesn't seem to be a difference between
>
> <@cut f. 1 :'u ' 'a b c'
>
> <@cut f. 1 :'u y' 'a b c'
True, but that's a different example from the example which I was
trying to propose:
L.<@(cut f. 1 :'u ') 'a b c'
3
1 :'u' is the same as if nothing was there. 1 : 'u y' limits the scope of $:
inside u to just itself, instead of "growing" to include <@
On Wednesday, February 9, 2022, 04:34:44 p.m. EST, Raul Miller
wrote:
On Wed, Feb 9, 2022 at 4:13 PM 'Pascal Jasmin' via Programming
wrote:
> th
On Wed, Feb 9, 2022 at 4:54 PM 'Pascal Jasmin' via Programming
wrote:
> 1 :'u' is the same as if nothing was there. 1 : 'u y' limits the scope of
> $: inside u to just itself, instead of "growing" to include <@
Yes.
Thanks,
--
Raul
---
13 matches
Mail list logo