REBOL 3.0

Comments on: The first resident embedded module

Carl Sassenrath, CTO
REBOL Technologies
11-May-2009 3:01 GMT

Article #0199
Main page || Index || Prior Article [0198] || Next Article [0200] || 3 Comments || Send feedback

A53 modularizes the HTTP scheme.

What does that mean? It means the HTTP implementation, including it's functions and other values, are no longer part of the global context.

In A52:

>> ? sync
Found these words:
read-sync-awake function! [event [event!] /local error]
sync-op         function! [port body /local state]

Those are internal functions of HTTP and should be hidden.

But, in A53:

>> ? sync
No information on sync

That's how it should be.

Method used:

To encapsulate the HTTP module within the rest of the code, I used this line:

import module spec body

Where spec is the module header block and body is its code block.

The module helper builds the module, and import adds it to the system/modules list as 'http.

Note that the scheme port definition creation part of the protocol is within the module body itself. That mechanism is separate from modularization. In fact, the HTTP module has no exports! All of its features are accessed via the port sub-system.

To see the source, open R3 Chat, login, and type:

user>> 27
R3/Protocols...
user>> get prot-http.r
--- Note: wrote file: work/r3/protocols/prot-http.r

3 Comments

Comments:

DideC
12-May-2009 3:57:23
This is good.

My only complaint is on the 'module word used to build the module. I understand that it's like the 'context word to build objects, but it does not implied the action it does : to make a module.

So a verb would sound better to me. I'm not native english speaker so I have nothing better than 'make-module that you surely think is too long.

Brian Hawley
13-May-2009 15:21:06
I understand that it's like the 'context word to build objects

Or like the OBJECT function to build objects, or the FUNCTION function to build functions, or the CLOSURE function to build closures, or the ARRAY function, or any number of other builder function that have an implied MAKE-. Don't worry about it :)

Carl Sassenrath
14-May-2009 15:08:21
DideC: yes, I had that same concern, but like any language (especially human languages), there are always a few exceptions, just to make things readable and practical.

Post a Comment:

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

Name:

Blog id:

R3-0199


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 19-Apr-2024 - Edit - Copyright REBOL Technologies - REBOL.net