REBOL3 tracker
  0.9.12 beta
Ticket #0001377 User: anonymous

Project:



rss
TypeWish Statustested Date12-Dec-2009 12:13
Versionalpha 95 CategoryNative Submitted bymeijeru
PlatformAll Severityminor Prioritynormal

Summary PICK with a word as selector could work on PAIR! values
Description In addition to series, PICK works (amongst others) on gob! pair! date! and time! values. These allow their components to be selected both by integers and by a limited number of words (as if they were objects). PICK can have a word as selector in the case of object!, map!, date! and time! but NOT with a pair! value. This seems like an oversight.
Example code
>> d: now
>> d/month
== 12
>> pick d 'month
== 12
>> t: now/time  
>> t/hour
== 13
>> pick t 'hour
== 13
>> p: 3x4
>> p/x
== 3
>> pick p 'x
** error

Assigned ton/a Fixed inalpha 98 Last Update6-May-2010 09:09


Comments
(0001858)
BrianH
13-Dec-2009 23:38

There is code in the GUI that could benefit from this, particularly dynamic layout code in styles, which uses complex path expressions instead like this:

w: pick [x y] greater? hx hy
p/:w

Or ordinal PICK like this:

pick p [1 2] greater? hx hy

POKE would still not work because of pairs are immutable.
(0002002)
BrianH
8-Feb-2010 01:48

Marked as a problem until #1476 is fixed.
(0002292)
meijeru
1-May-2010 11:24

The fix of #1476 has now happened, so this one can be back to built/tested/complete.

Date User Field Action Change
6-May-2010 09:09 BrianH Status Modified built => tested
2-May-2010 20:39 BrianH Fixedin Modified alpha 97 => alpha 98
2-May-2010 20:39 BrianH Status Modified problem => built
1-May-2010 11:24 meijeru Comment : 0002292 Added -
8-Feb-2010 01:48 BrianH Comment : 0002002 Added -
8-Feb-2010 01:41 BrianH Status Modified built => problem
6-Feb-2010 22:45 Carl Fixedin Modified => alpha 97
6-Feb-2010 22:45 Carl Status Modified reviewed => built
13-Dec-2009 23:38 BrianH Comment : 0001858 Added -
13-Dec-2009 22:43 BrianH Summary Modified PICK with a word as selector does not work on PAIR! values => PICK with a word as selector could work on PAIR! values
13-Dec-2009 22:43 BrianH Description Modified -
13-Dec-2009 22:43 BrianH Code Modified -
13-Dec-2009 22:43 BrianH Status Modified submitted => reviewed
13-Dec-2009 22:43 BrianH Type Modified Bug => Wish
12-Dec-2009 12:13 meijeru Ticket Added -