Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

New Type of Variable

 [1/5] from: info:id-net:ch at: 19-Apr-2002 10:28


Hi! I want to know if someone has an idea how to add some datatypes. I like the idea of having for the pair datatype the /path 1 and 2 to extract the first and second part of the pair, besides the X. Same thing for time datatype, with /minute and hour refinement. Is it possible to make it the same easily for other "string". I.e. it should be interesting of having a x-number of part of a string separated by a symbol : 34,45,34,67,45,56 This "datatype" would be access like that : thestring/6 and the result will 45.. And the modification will be easy, too thestring/6: 23 The long introduction to say that I often use the parse and the join function to parse a string and then to rejoin only to change some of its componants.. If someone has a easy and reliable method to "add datatype" or something like that.. Philippe

 [2/5] from: anton:lexicon at: 20-Apr-2002 21:56


Phillipe, there is no way to add datatypes at this time. The only way is to ask Rebol Technology to add your datatype :) (But first you should run it through this list to see what others think...) You could make an object to do something similar, though. Anton.

 [3/5] from: joel::neely::fedex::com at: 20-Apr-2002 8:31


Hi, Philippe, How does your desired feature differ from the existing STRING! (and more generally, SERIES!) capabilities? Philippe Oehler wrote:
> Hi! > I want to know if someone has an idea how to add some datatypes.
<<quoted lines omitted: 8>>
> thestring/6 and the result will 45.. > And the modification will be easy, too thestring/6: 23
Copied directly from my console transcript:
>> foo: "bletch"
== "bletch"
>> foo/3
== #"e"
>> foo/3: #"o"
== "blotch"
> The long introduction to say that I often use the parse and the > join function to parse a string and then to rejoin only to change > some of its componants.. > If someone has a easy and reliable method to "add datatype" or > something like that.. >
Can you provide an example of a problem of the sort you're thinking about? Perhaps there are nice solutions already. I certainly have had the experience of working out a "brute force" solution for some small task, only to discover later that REBOL already has some nice tool in its toolkit that handles the case nicely! (Of course, that is not *always* the case, but it's worth rummaging around... ;-) -jn- -- ; Joel Neely joeldotneelyatfedexdotcom REBOL [] do [ do func [s] [ foreach [a b] s [prin b] ] sort/skip do function [s] [t] [ t: "" foreach [a b] s [repend t [b a]] t ] { | e s m!zauafBpcvekexEohthjJakwLrngohOqrlryRnsctdtiub} 2 ]

 [4/5] from: info:id-net:ch at: 22-Apr-2002 20:51


Has someone made an object to create special datatypes ?
> Phillipe, there is no way to add datatypes at this time. > The only way is to ask Rebol Technology to add your > datatype :) (But first you should run it through this list > to see what others think...) > > You could make an object to do something similar, though. > > Anton. >
Hi! I want to know if someone has an idea how to add datatypes. I like the idea of having for the pair datatype the /path x and y to extract the first and second part of the pair, besides the X. Same thing for time datatype, with /minute and hour refinement. Is it possible to make it the same easily for other "string". I.e. it should be interesting of having a x-number of part of a string separated by a symbol : 34,45,34,67,45,56 This "datatype" would be access like that : thestring/6 and the result will 45.. And the modification will be easy, too thestring/6: 23 This long introduction to say that I often use the parse and the join function to parse a string and then to rejoin only to change some of its componants.. If someone has a easy and reliable method to "add datatype" or something like that.. Philippe

 [5/5] from: anton:lexicon at: 24-Apr-2002 11:51


Can you give us some examples of what you need it for? Something must have caused you to think of this. Does your example below actually have an application? Anton.

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted