REBOL 3.0

Comments on: Datatype Specs

Carl Sassenrath, CTO
REBOL Technologies
4-May-2006 18:41 GMT

Article #0022
Main page || Index || Prior Article [0021] || Next Article [0023] || 8 Comments || Send feedback

How many times have you wanted to type:

help time!

or:

help event!

to get more information about the specific features of a datatype?

In REBOL 3.0 datatypes will include a specs block similar to that found in functions. This will allow you to query any datatype to find out more about it, such as a short description, general category (block or string), range or limits, and what path fields or indexes have meaning to it (e.g. date/yearday, time/hour, event/type).

This addition will make the help function more useful and make REBOL more friendly to new users.

One issue to think about: should the spec be a block or an object? A block is consistent with functions, but an object is simpler (not a spec dialect) and easier to access. Post your comments.

8 Comments

Comments:

Volker
4-May-2006 15:48
first thought: like functions. Because i want (more or less) help 4-may-2006 and then a help similar to a functions. And that is only a step away: For functions take "third :value", for everything else "options? type? :value" and the rest of code is the same.
Gregg Irwin
4-May-2006 17:05
I know I seem to ask more questions than post comments here lately, but...

Do you have specific ideas for how people might use this, beyond HELP? e.g.

Will you be able to say integer!/max? (or something similar) to find out the max value a type supports? Or will a func, like INFO?, or an oridinal be used to return the information.

I know it can be useful when creating UI's, to be able to provide feedback on limits and such, so I hope this is something that will extend to user defined datatypes, where it is *much* more useful (e.g. related to constraints like positive numbers, specific values, etc).

I like dialects myself, if this is something we'll use when creating user defined types. An info object makes sense if that's the interface to it.

Any ideas on how this will blend, and be used with, typeset! info or how constraints are defined and applied with set-funcs?

Carl Sassenrath
4-May-2006 17:24
Volker: there will be some new functions such as spec-of?, word-of?, size-of?, code-of?, data-of?
Carl Sassenrath
4-May-2006 17:31
Gregg: a lot of questions.

Help is the main thing, to start.

Access method not yet defined, but I am leaning toward functions. Reason is to avoid clashing with paths.

It's important to only store spec/doc/control info in this way. Anything data related should appear with the data of a type.

This method will be key to the use of types in objects. Set-funcs not yet known.

Philippe
5-May-2006 1:15
:) Hi,

Carl, you don't talk in the blog about localisation. Is a way in Rebol 3.0 to localize our scripts ? Do we have in objects or functions optionnal information depending from our language setting ?

Anton Rolls
5-May-2006 1:20
I like replacing ordinals, but did you consider OF as an infix operator, with the first argument taken literally ? eg:

spec of ... data of ...

Cuts down on extra words and it's more English-like.

Alessandro Pini
5-May-2006 8:04
YES! I like it!

Help is good, help is needed, help is helpful when it's at hand!

Also consider optionally listing every function you can use the datatype in question with. Newbie: "Oh, I can subtract one date! from another?.. Nice! And I can traverse a url! backwards?.."

maximo
5-May-2006 13:36
yippe help on data!!!!!

I prefer the spec dialect. more flexible.

I would like the spec block in general (datatype and func) to support assigning a "category" like element. maybe a block! before any word, just like the string description.

This would allow easy "see also:" usage and allow automated documentation to include references to other related words. we could also plug our own functions into things like word browsers and they would be grouped under tabs properly.

Post a Comment:

You can post a comment here. Keep it on-topic.

Name:

Blog id:

R3-0022


Comment:


 Note: HTML tags allowed for: b i u li ol ul font span div a p br pre tt blockquote
 
 

This is a technical blog related to the above topic. We reserve the right to remove comments that are off-topic, irrelevant links, advertisements, spams, personal attacks, politics, religion, etc.

REBOL 3.0
Updated 7-Oct-2024 - Edit - Copyright REBOL Technologies - REBOL.net