REBOL 3.0

REBOL 3.0 Front Line

Carli Carl Sassenrath, CTO
REBOL Technologies
9-Feb-2010 12:59 GMT

892422 visits since 15-March-2007
RSS Feed URL
Send me feedback

Search:

Purpose:
This blog provides advanced technical notes and discussions regarding the design and implementation of the new REBOL 3.0 system. It is intended for experts.

Also Visit:
Carl's REBOL Blog
REBOL 3 Home Page

Recent Comments::
0306 0302 0305 0304 0303 0300 0286 0298
Review all comments for week or month

Recent Articles:

8-Feb-2010 - Plans for A98 with Host Kit changes [0307]
6-Feb-2010 - Comma as a delimiter in some special cases? [0306] 12 Cmts
6-Feb-2010 - Those tricky < and > characters [0305] 1 Cmts
5-Feb-2010 - MOLD vs TO STRING! [0304] 7 Cmts
12-Jan-2010 - R3 A97 will be a bug fix build [0303] 1 Cmts
23-Dec-2009 - Post your favorite new PARSE examples [0302] 15 Cmts
12-Dec-2009 - Host Kit for Linux released - More to follow [0301] 59 Cmts
9-Dec-2009 - Modules: another EXPORT method proposed [0300] 28 Cmts
4-Dec-2009 - Next stage. Dialects vs functions. Graphics API... more. [0299] 3 Cmts
2-Dec-2009 - R3 Host Kit prototype released [0298] 6 Cmts
24-Nov-2009 - A95 jump in size due to compiler optimizations [0297] 9 Cmts
23-Nov-2009 - R3 Math Speed [0296] 13 Cmts
23-Nov-2009 - Want larger MAPs? Send me some primes. [0295] 9 Cmts
11-Nov-2009 - Finalizing READ and WRITE [0294] 25 Cmts
10-Nov-2009 - Changes to high resolution time in R3 [0293] 1 Cmts
7-Nov-2009 - PROTECT with path targets [0292] 1 Cmts
Contents- Index of all articles.

8-Feb-2010 - Plans for A98 with Host Kit changes [0307]

If you have inputs regarding the R3 Host Kit, please make sure we know about them. Actually, it would help if we can get someone collect and sort developer comments, notes, and any changes... otherwise something may get missed. This includes inputs/changes on the R3 makefile (e.g. Kaj's feedback). The sooner we get the list organized, the sooner we can get A98 out.

Don't post the list here, upload it as a text file to the R3 Chat #358 topic "R3/Plans/Priorities". (Reminder: To post a file use the submit command while within the 358 topic.)

Post Comments


6-Feb-2010 - Comma as a delimiter in some special cases? [0306]

As you know, REBOL does not use commas. This design decision is critical to the foundation of the language.

In REBOL we write:

[1 2 3]

not:

[1, 2, 3]

Why? Simple, because we want to write:

[1 + 2]

not:

[1, +, 2]

Think about that carefully. In REBOL data can be code, and code can be data. Commas would prevent that concept from working properly. This property makes REBOL quite special and unique in the world of programming languages. So, it's fundamental.

Now, ticket #537 requests a change to the lexical analyzer to give higher strength to commas. Several people have asked for it over the years. What's desired is if someone provides data in the form:

a, b, c

We can easily use the REBOL scanner to parse it without too much trouble.

I spent some time today looking into this request. It's possible, but non-trivial.

While comma doesn't have any special significance in the lexicon, it is used for non-English style decimal points... worldwide. That is, in REBOL:

1.23 = 1,23

People in the USA freak out on that, but if they travel to say, Paris, after the initial shock, they get the idea. I suppose it works the opposite direction as well.

Anyway, comma is not a delimiter in REBOL, it's just a special character used for numbers.

Now that all that's clear, can comma be made a bit stronger to act more like a delimiter? Perhaps. But, we'd need to resolve this ambiguous case:

[abc,123]

Which of these lines would be the correct result?

[abc 123]
[abc 0.123]
**error: comma found in expression

Now, what happens if we write:

[abc,123,456]

Hmmm. You begin to see the problem, and it's non-trivial because comma means two different things here.

So, after some thought, I think we're better off leaving such lines to be processed as strings by parse and keeping the REBOL lexical analyzer as it is.

12 Comments


6-Feb-2010 - Those tricky < and > characters [0305]

A97 Fixes

Release A97 should fix most or all of these related issues. Please try it out.

In the REBOL lexicon, the < and > "arrow" characters are special, and must be scanned (lexically analyzed) in special ways.

To understand the situation, notice that arrows denote two datatypes, word! and tag!:

>> type? second [a < b]
== word!
>> type? second [a > b]
== word!
>> type? second [a <> b]
== word!
>> type? second [a <c> b]
== tag!

To avoid problems, we don't allow arrows to be part of most words. This avoids creating ambiguous lexical sequences such as:

a <c b d e>

Are those arrows as words or are they part of a tag?

To simplify such cases, we restrict the usage of arrows when used for words. We allow these words:

< <= << <> >> >= >

If you attempt to use arrows within words in general, you'll see an error:

>> a<
** Syntax error: invalid "word" -- "a<"
** Near: (line 1) a<

However, we do want to allow this common markup usage in a sensible way:

>> [<b>word</b>]
== [<b> word </b>]

So, that's even more tricky to scan.

Now, all this being said, we know there are a few minor bugs related to arrows in the scanner. They are listed in the R3 CureCode bug database, and they will be fixed.

For example, we need to allow lit-word quoting of arrow words:

>> if word = '< [...]
** Syntax error: invalid "word-lit" -- "'"
** Near: (line 1) if word = '< [...]

But, I simply wanted to point out this issue, so it is understood that arrows are not general-usage word characters.

1 Comments

View index of all articles...

REBOL 3.0
Updated 9-Feb-2010 - Edit - Copyright REBOL Technologies - REBOL.net