Tag Archives: Model

More about “new”

Picking up the topic of Model implementation two years later, some further thoughts about the new method as well as about the set and get methods.

The summary here is that all three are virtual methods built into the implementation. They have to be to handle the under-the-hood aspects of Instances. They can be “extended” by user code, but not over-ridden.

Continue reading →


Implementing “new”

One of the last hurdles involves the implementation of the new behavior. Models manage Instance value objects and provide new data objects (used by Instance objects to populate Call Frame slots). Model objects must provide an API to support creating and destroying Instance objects as well as manipulating their value objects.

Continue reading →

Binding Instances and Models

There is a design choice involved with regard to how Instance objects are bound to their Model object. A similar choice exists concerning Actor objects and their Action objects. (Actors can be called “instances” of an Action.)

The choice is between a BOOL-like design where the Instance sends a message to the Model, or an implementation design that lets the Instance directly call the Model. This post documents the two choices and the resolution to use the latter.

Continue reading →

Casting Values

There is the situation when an operation takes multiple operands, and one (or more) of those operands are inappropriate for the operation. For example, suppose an integer add operation was passed an integer object and an open file object? There is generally no “add” semantic for an integer and a file.

Total incompatibility results in a run-time error, but sometimes values are compatible enough for the operation to proceed. How the system accomplishes that often involves casting one value into another.

Continue reading →

It’s Alive! (Sort of)

There was meant to be a third article in the Native Objects series that would discuss the Actions (“methods”) supported by the native Models (“classes”). But I’ve only begun to define those things. For now, suffice to say that typical data types (integers, floats, strings, etc.) have the methods you’d expect. Assignment for all, basic math for the numeric types, stringy stuff for the string; you get the idea.

I’ve reached another major milestone, but I’m also about to begin another design phase as I figure out exactly how to implement the native Models. And I may be taking a break from this blog to give BOOL a rest and to deal more with other matters.

Continue reading →

Native Objects, part 2

The previous article introduced the basic run-time environment, the native @system and @global Actions that harbor all code and data objects. This article describes the required native Models and Actions found in the @system Action. There is a core set of Models required for BOOL to function and an extended set that provides more complex data types (such as trees and tables).

Continue reading →

Arrays, Final(ly)

I think the final piece of the array puzzle finally fell into place. The issue resolved when I last wrote about arrays — whether all data Models have array capability versus arrays being a distinct data model — still stands.

The final piece involves a slight syntax change and — much more importantly — the full rationale for the array syntax. Not really having one was a bother; it made arrays seem arbitrary and patched on. The rationale brings them more fully into the BOOL fold.

Continue reading →

BOOL Python Binding

Again the retirement free time, the pleasure of Python, and perhaps it just being the right time, conspire to move the BOOL project forward into new territory. The Reference Implementation is coming along nicely on several fronts. The design of various objects has become solid enough to use in writing bits of code.

In particular, it’s possible to discuss how objects are represented in Python, and it’s possible to start thinking about the code that works with those objects. With the BOOL source definition becoming more stable, it’s also possible to start thinking about compilers. This post introduces these things; in some cases, in some detail.

For dessert, I’ll briefly mention a BOOL XML binding.

Continue reading →

Invoking Actions

Finally, a post not filed under Basics!  I’m in a BOOL development mode (they come and go over the years), so more advanced topics are likely. I’m making what feels like excellent progress. Maybe once this phase completes, I can set down to the business of really documenting BOOL here.  (Assuming the development doesn’t end in frustration and tears and I put the whole mess on the shelf for another few years.)

I’ve been mucking about with my Python implementation trying to work my way through an implementation aspect I’ve never been able to see clearly. It has to do with how BOOL invokes code sub-units. We’re talking about “calling” what are variously called: sub-routines, routines, functions, procedures, methods or sub-programs. At least the term “call” is fairly global; in fact, the generic term for these things is “callable unit.”

Continue reading →

Symbol Crazy

By now you’ve noticed that BOOL uses a lot of symbols. It steals (and runs with) the ball from Perl mostly, which uses punctuation symbols to determine basic data types (scalar, array, hash, and so forth). Many forms of BASIC have also used punctuation symbols to determine data type.

BOOL uses them to define basic meta-types of objects in BOOL, and it uses them to distinguish between definitions of new objects and references to existing objects.

And while it does make BOOL have a bit of that “line noise” look that so uglifies Perl, the syntax has been there from the very beginning, so it’s not going anywhere. Consider it part of BOOL’s “charm”.

Continue reading →