Assigning to an expression with dfns
2 posts
• Page 1 of 1
Assigning to an expression with dfns
v←0 0
myfunc←⊃
(2⊃v)←3
(2 myfunc v)←2
SYNTAX ERROR
(2 myfunc v)←2
∧
myfunc2←{⍺⊃⍵}
(2 myfunc2 v)←2
SYNTAX ERROR
(2 myfunc2 v)←2
∧
Why?
How to create a kind of custom sub-select function that could be used on the left side of assignment?
-
OSRK - Posts: 17
- Joined: Tue Dec 27, 2016 8:48 am
Re: Assigning to an expression with dfns
The selective assignment construct allows only a subset of primitive functions inside its parentheses. These primitive functions are being applied to an internal structure representing the indices of the subject array, which is meaningless to more general functions, such as the dfn {⍺⊃⍵} in your myfunc2 example.
PS: for selective specification of array items, try the primitive @ operator.
John
PS: for selective specification of array items, try the primitive @ operator.
3@2 ⊢0 0
0 3
John
- JohnS|Dyalog
2 posts
• Page 1 of 1
Return to Functional Programming
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group