REBOL 3.0

Comments on: Make Function! Must Change

Carl Sassenrath, CTO
REBOL Technologies
8-Apr-2006 22:39 GMT

Article #0003
Main page || Index || Prior Article [0002] || Next Article [0004] || 1 Comments || Send feedback

There is a long-time inconsistency in REBOL's implementation of make that will be changed in REBOL 3.0. (But, it will have very little affect on most programs.)

If you ask REBOL about the make function, it responds like this:

>> ? make
USAGE:
    MAKE type spec

DESCRIPTION:
     Constructs and returns a new value.
     MAKE is an action value.

ARGUMENTS:
     type -- The datatype or example value. (Type: any-type)
     spec -- The attributes of the new value. (Type: any-type)

So if that is true, then how can the line below be valid?

f: make function! [a] [print a]

In this example make is given three arguments, but the function's interface specification only describes two arguments, type and spec.

This will change in REBOL 3.0. Here's why it must be done:

  1. A program must be able to precisely rely on function interface specifications. This is important not only for things like debugging tools, but also for proper reflection (code to data back to code).

  2. The older approach required a nasty hack in the implementation of REBOL evaluation to "spoof up" the extra argument. Removing it will simplify the code and increase the speed of REBOL.

The new form of make function will be:

f: make function! [[a] [print a]]

This is consistent with the interface specification.

How will this change affect compatibilty? Very little. Most programs do not use this form of function creation; they use the helper functions func, function, does, or has.

1 Comments

Comments:

Graham
29-Nov-2017 15:14:59
Are you around Carl?

Post a Comment:

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

Name:

Blog id:

R3-0003


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 12-Dec-2017 - Edit - Copyright REBOL Technologies - REBOL.net