Comments on: Datatype Specs
How many times have you wanted to type:
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.
first thought: like functions. Because i want (more or less)
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.|
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?
Volker: there will be some new functions such as spec-of?, word-of?, size-of?, code-of?, data-of?|
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.
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 ?
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.
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?.."
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.