REBOL 3.0

Comments on: The SPEC-OF an Object

Carl Sassenrath, CTO
REBOL Technologies
12-Nov-2010 5:31 GMT

Article #0350
Main page || Index || Prior Article [0349] || Next Article [0351] || 5 Comments || Send feedback

In R3, functions have "specs". These are interface and operational specifications. For example, arguments passed to a function, help strings, return values, exception handling, trace/profile controls, etc.

It is intended for objects (hence modules) to also accept a spec. This is one way to provide help strings for an object, enforce typing of the object's fields, along with other features.

The problem is: what should be done with specs when a sub-object is made. If we keep the spec, it would be nice to make it a reference, not a copy.

Then, there's the issue of mold: would all sub-objects mold the spec back or not?

So, it's not well defined. It may need to wait for post 3.0.0.

5 Comments

Comments:

Sunanda
12-Nov-2010 12:45:32
If the spec of a sub-object is a reference, what happens when the parent-object is deleted or redefined?

Right now, spawning an object from another object creates an independent entity that can be molded, deleted, changed, etc without reference to the parent.

It sounds to me that trying to share a linear hierarchy of object specs would be less useful than the current independent spawning model.

Brian Hawley
12-Nov-2010 15:08:22
Selfless contexts also need a way to be specified in the object spec block, or else they can't mold properly.
Brian Hawley
13-Nov-2010 18:42:40
Sunanda, the spec could be shared without it being a problem if the parent is deleted. The sub-object would have a reference to the spec, not necessarily the parent itself. We don't have to worry about deletion because we have garbage collection. We don't have to worry about redefinition because it would be a new definition, not a change to the original. There is no reason to not have copy-on-write for specs. Remember, specs aren't the data part with the words and such; specs wouldn't really change much, for security reasons and because many of the settings in them could only be set at object creation time. We may even be able to get away with making specs read-only.

It looks like sub-objects should mold the spec back, as if they were created from scratch. Spec sharing is more of an internal issue, isn't it? Leave the full shared reference serialization issue to Rebin.

The other issue that needs to be considered is syntax.

Gucci sneakers store
11-Jul-2012 21:54:32
All Gucci sneakers store is made from superior material and crafted carefully and intricately to ensure the best quality. Gucci shoes are some of the finest designer shoes on today's market. As leaders in high fashion, Gucci sneakers store's line always features the latest, most stylish shoes. As they are high in demand and well-made, Gucci sneakers are always available in expensive prices. You can, however, find more affordable Gucci shoes, if you know where to look. So searching on internet is really a good option to find your favorite pair of Gucci Sneakers. You could also find some great discounts if you are lucky and finding the most wanted brand while sitting at home is really a good experience for anybody.
Supra shoes for girls
16-Jul-2012 22:37:16
The Supra shoes for girls Asia this training camp lineup,More than 50 players from China, Hong Kong, China, Chinese Taipei, Japan, Korea, Australia and other countries and regions,Players in the Supra shoes for girls list, we are familiar with the noble, Supra shoes for girls and consultant in the lineup, not only have Yi Jianlian, Gay and DeRozan and the other two NBA players, as well as the former coach of the United Arab O'Connor, and Chinese star Du Feng and so on.

Post a Comment:

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

Name:

Blog id:

R3-0350


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 29-Mar-2024 - Edit - Copyright REBOL Technologies - REBOL.net