Search found 8 matches

by marc
Wed Sep 16, 2015 4:47 pm
Forum: Language
Topic: Reduction and the rank operator
Replies: 2
Views: 9859

Re: Reduction and the rank operator

Thanks Phil, that makes sense.
by marc
Wed Sep 16, 2015 1:12 pm
Forum: Language
Topic: Reduction and the rank operator
Replies: 2
Views: 9859

Reduction and the rank operator

Would anyone be able to clarify the interaction between the rank and reduction operators? For example, given the following session: +⌿[1]a←2 3 4⍴⍳24 12 15 18 21 48 51 54 57 +/[1]a 12 15 18 21 48 51 54 57 (+⌿⍤2)a 12 15 18 21 48 51 54 57 (+/⍤2)a 6 22 38 54 70 86 it's unclear to me why reduce and reduce ...
by marc
Thu Feb 09, 2012 2:44 pm
Forum: Functional Programming
Topic: Inlining d-fn references
Replies: 8
Views: 33367

Re: Inlining d-fn references

Hi John, Glad to hear that folks are interested in this functionality. How tricky do you think it would be to resolve scoping issues as part of a refactor? Presumably some sort of disambiguation prompt ought to be presented so that the programmer can clarify their intended binding(s).... Re: "Wouldn ...
by marc
Thu Feb 09, 2012 2:33 pm
Forum: Functional Programming
Topic: Inlining d-fn references
Replies: 8
Views: 33367

Re: Inlining d-fn references

Hi Dick,

Sorry, I should have clarified that index origin was 1:

      ⎕io←1
foo ← {+⌿⍵}
bar ← {2*⍨foo⍵}
foo ⍳3
6
bar ⍳3
36
{2*⍨{+⌿⍵}⍵} ⍳3
36
⎕io←0
foo ⍳3
3
bar ⍳3
9
{2*⍨{+⌿⍵}⍵} ⍳3
9
by marc
Thu Feb 09, 2012 8:37 am
Forum: Functional Programming
Topic: Inlining d-fn references
Replies: 8
Views: 33367

Re: Inlining d-fn references

Hi Dan, Thanks for your reply. This is a refactoring question—I sometimes have a number of (very) short d-fns defined over the course of a session that are not intended for direct use but rather contribute to a larger expression. Occasionally the larger expression is more meaningful when the e ...
by marc
Wed Feb 08, 2012 8:32 am
Forum: Functional Programming
Topic: Inlining d-fn references
Replies: 8
Views: 33367

Inlining d-fn references

Let's say that I have the following d-fns defined:

      foo ← {+⌿⍵}
bar ← {2*⍨foo⍵}

foo ⍳3
6
bar ⍳3
36

Can the call to 'foo' in 'bar' to be inlined—either through the editor or a system function—to yield,

      {2*⍨{+⌿⍵}⍵}

or similar?
by marc
Tue Feb 07, 2012 3:17 pm
Forum: Functional Programming
Topic: Influence of J?
Replies: 2
Views: 12574

Re: Influence of J?

Thanks for the clarification, John—interesting to hear that J inspired the implementation of function inverses. Looking over the literature, I see that direct definitions were discussed (in print) at least as early as 1978 (m). My original question was probably overly simplistic; it would have been m ...
by marc
Mon Feb 06, 2012 1:22 pm
Forum: Functional Programming
Topic: Influence of J?
Replies: 2
Views: 12574

Influence of J?

Out of curiosity: How influential has J been on the design of D-{fns, ops}, the inclusion of the power operator (especially limits and inverses) and other functional features of "D"?