Improper Behaviour From Arrays of Objects?
12 posts
• Page 2 of 2 • 1, 2
Re: Improper Behaviour From Arrays of Objects?
I wouldn't object to a length error on
(1⍴n).f'this'but for my money I'd sooner see it stay the way it is than have
(1⍴n).fbehave like
(⍬⍴n).fand please don't think of adding significance to redundant parentheses!
-
Phil Last - Posts: 628
- Joined: Thu Jun 18, 2009 6:29 pm
- Location: Wessex
Re: Improper Behaviour From Arrays of Objects?
Phil,
Well the parentheses seemed like a reasonable way out of this mess - by APL2 standards I'm not sure they are redundant:
I know Dyalog allows:
a b c←5
but in APL2 you would need to specify the assignment as:
(a b c)←5
The parentheses are not redundant -- a notation I much prefer, but I see your point in this case.
I guess my point is if we are carrying on with the original 50-year old mistake of treating a 1-element vector the same as a scalar, then it should hold true for the dot notation as well or we should dispense with it here. As the language advances, this original gaff becomes bigger and more difficult to program around:
(⍳,5)≡⍳5
1
Well the parentheses seemed like a reasonable way out of this mess - by APL2 standards I'm not sure they are redundant:
I know Dyalog allows:
a b c←5
but in APL2 you would need to specify the assignment as:
(a b c)←5
The parentheses are not redundant -- a notation I much prefer, but I see your point in this case.
I guess my point is if we are carrying on with the original 50-year old mistake of treating a 1-element vector the same as a scalar, then it should hold true for the dot notation as well or we should dispense with it here. As the language advances, this original gaff becomes bigger and more difficult to program around:
(⍳,5)≡⍳5
1
- Erik.Friis
- Posts: 66
- Joined: Mon Apr 04, 2011 3:16 pm
12 posts
• Page 2 of 2 • 1, 2
Return to Object Oriented Programming
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group