⎕R oddity - [resolved]
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !
3 posts
• Page 1 of 1
⎕R oddity - [resolved]
('-' 'ef'⎕R'¯' 'x')'-ab cd ef'
¯xab cd ¯x <- I expected ¯ab cd x
('-' 'ef'⎕R'¯' 'xx')'-ab cd ef'
¯ab cd xx
('-' 'ef'⎕R'¯' 'xxx')'-ab cd ef'
¯ab cd xxx
('-' 'cd'⎕R'¯' 'x')'-ab cd ef'
¯xab ¯x ef <- I expected ¯ab x ef
('-' 'cd'⎕R'¯' 'xx')'-ab cd ef'
¯ab xx ef
('-' 'cd'⎕R'¯' 'xxx')'-ab cd ef'
¯ab xxx ef
Doesn't seem fully right, imho? x's and -'s appear at unexpected locations in the single-character cases. Anyone who could explain the behaviour for me?
#.DISP #.APLVersion
┌───────┬────────────┬─┬───────────┐
│Windows│14.0.23160.0│W│Development│
└───────┴────────────┴─┴───────────┘
Last edited by Tomas Gustafsson on Mon Jan 12, 2015 3:23 pm, edited 1 time in total.
- Tomas Gustafsson
- Posts: 101
- Joined: Mon Sep 19, 2011 6:43 pm
Re: ⎕R oddity
First off
I guess if ⍺⍺ is a nested list and ⍵⍵ is a simple string then the string applies to all members of ⍺⍺. Normally you'd expect item conformability so that you'd need to enclose ⍵⍵ if you wanted it to apply to each ⍺⍺. But of course they aren't function arguments, they're operands. Nor is ⎕R scalar.
You could ensure what you expect by
'¯' 'x' ≡ '¯x'
I guess if ⍺⍺ is a nested list and ⍵⍵ is a simple string then the string applies to all members of ⍺⍺. Normally you'd expect item conformability so that you'd need to enclose ⍵⍵ if you wanted it to apply to each ⍺⍺. But of course they aren't function arguments, they're operands. Nor is ⎕R scalar.
You could ensure what you expect by
('-' 'ef'⎕R(,¨'¯' 'x'))...
-
Phil Last - Posts: 628
- Joined: Thu Jun 18, 2009 6:29 pm
- Location: Wessex
Re: ⎕R oddity
Ah, good point Phil. I tried
but not
Thx!
⎕R ,¨ ... )
but not
⎕R (,¨ ...) )
Thx!
- Tomas Gustafsson
- Posts: 101
- Joined: Mon Sep 19, 2011 6:43 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group