REBOL3 tracker
  0.9.12 beta
Ticket #0001887 User: anonymous

Project:

Previous Next
rss
TypeWish Statusreviewed Date10-Jul-2011 15:25
Versionalpha 112 CategoryDatatype Submitted byGHigley
PlatformAll Severitytrivial Prioritylow

Summary ANY-MAP!
Description Perhaps a built-in ANY-MAP! typeset would be useful. It would be the equivalent of SERIES! except for types that support getting a value by supplying a key to the SELECT function.

Sure, it's easily created, as demonstrated below, but it strikes me as the kind of thing that should be included for the sake of completeness and consistency.
Example code
any-map!: make typeset! [any-object! block! map!]
any-map?: funct [
    "Return TRUE if value is any type of map."
    value [any-type!]
][find any-map! type? :value]

Assigned ton/a Fixed in- Last Update10-Jul-2011 18:08


Comments
(0003186)
BrianH
10-Jul-2011 18:08

>> select "ab" #"a"
== #"b"

SELECT works with all series types, not just blocks. An any-map! type defined as having SELECT work that way would include all of the container types in R3, and some port types too. There doesn't seem to be a reason for an any-map! type, though if you want to call it selectable! in your own code that would be cool.

>> selectable!: exclude first types-of :select make typeset! [none!]
== make typeset! [binary! string! file! email! url! tag! image! vector! block! paren! path! set-path! get-path! lit-path! map! object! port!]

Date User Field Action Change
10-Jul-2011 18:08 BrianH Description Modified -
10-Jul-2011 18:08 BrianH Code Modified -
10-Jul-2011 18:08 BrianH Status Modified submitted => reviewed
10-Jul-2011 18:08 BrianH Comment : 0003186 Added -
10-Jul-2011 15:25 GHigley Ticket Added -