Questions tagged [rebol]

Rebol is a modern interpreted language where code is data. It isn't object oriented, but has objects. It isn't a functional language but has first class functions. There are virtually no syntax rules or immutable keywords, making it ideal for developing domain-specific "dialects".

Rebol is a homoiconic language with heritage from , , , and . Language focus is on careful control of dependencies, and concern over the size of the interpreter and code...as well as achieving an English-like readability. The project's motto is "Rebel against software complexity".

On 12-Dec-2012, the unfinished ANSI-C sources of the Alpha release of Rebol3 was open-sourced under an Apache 2.0 License. Standalone "zero-install" binaries are available for x86 and ARM platforms--covering Linux/Windows/Mac/Android, 64-bit builds, hard-float compatibility and HaikuOS. Core builds are about half a megabyte, while GUI builds are around 1 megabyte (uncompressed).

(Note: Several forks of the code exist, with a community wiki summary at REBOL3 - what is the difference between the different branches?)

In addition to inheriting the "code is data" paradigm of Lisp, Rebol has a rich type system...natively recognizing patterns like URLs, dates, HTML tags, currency, and binary literals. Of note, Douglas Crockford (of JSON and JSLint) has credited Rebol as a source of inspiration for JSON, adding:

"Rebol's a more modern language, but with some very similar ideas to Lisp, in that it's all built upon a representation of data which is then executable as programs. But it's a much richer thing syntactically.

Rebol is a brilliant language, and it's a shame it's not more popular, because it deserves to be."

    —Douglas Crockford, founder of JSON, 2009 [link]

A modern compiled variant of Rebol which draws in several new concepts is , which is under heavy development.

696 questions
5
votes
1 answer

How do I pass a URL a cookie using Rebol 3?

Using R3, I need to get a localized version of a page from a website that uses cookies to handle this. In REBOL 2.x, I could do this: page: http://www.rci.com/resort-directory/resortDetails?resortCode=0450 read/custom page [header [Cookie:…
Edoc
  • 339
  • 4
  • 10
5
votes
2 answers

Why does random not work in GUI in REBOL?

This very simple script: REBOL [] view layout [ button "Rand" [alert to-string random 100] ] gives the following results: 1-st run: 95, 52, 80, 96 ... 2-nd run: 95, 52, 80, 96 ... 3-rd run: 95, 52, 80, 96 ... ... This is obviously not random…
Caridorc
  • 6,222
  • 2
  • 31
  • 46
5
votes
1 answer

How to parse currency values from a string using PARSE

I'm trying to parse currency values with Rebol 2/3 from a string, the currency values are in the format: 10,50 € OR 10,50€ This code I came up with after going through all PARSE documentation I could find works in Red, but not in Rebol 2 or…
5
votes
3 answers

How to wrap up a function with a refinement so the refinement isn't required?

I am trying to wrap up functions with refinements in a generic way so they can be called without the refinement. For instance, ARRAY-INITIAL size value instead of ARRAY/INITIAL size value wrap: function [refined [path!] args [block!]] [ …
5
votes
1 answer

What causes a misplaced item error in rebol?

Here is the code pruned down to a minimum to show the error: Rebol [] view center-face layout [ fld1: field fld2: field flds: [fld1 fld2] ]
johnorork
  • 51
  • 5
5
votes
1 answer

Read non success http data in rebol

Is there a way to read non success http data, for example for a 404, in Rebol? When open gets a non success http response code for an URL it fails with an error, but I would like to read the response instead.
rnyberg
  • 68
  • 5
5
votes
4 answers

How to retrieve a function from a series of functions and call it

I'm trying to create a dispatcher of functions in Rebol 3, so that for each string the program receives there's an associated function to be called. For example: handlers: make map! [ "foo" foo-func "bar" bar-func ] where foo-func and bar-func…
kronwiz
  • 193
  • 7
5
votes
2 answers

What is the undocumented block you get from THIRD on object/function in Rebol2?

I've read internally R2 stores contexts as two tables, one for words and the other for values, so you can ask for them: o: context [a: 1 b: 2] >> first o == [self a b] >> second o == [make object! [ a: 1 b: 2 ] 1 2] in any…
Pep
  • 451
  • 2
  • 9
5
votes
1 answer

Are OBJECT and CONTEXT synonyms in Rebol2?

My first assumption is that object and context are synonyms. So I created an object o and a context c. Probing them reports the same code construct, and also type is the same (both being type object!): >> o: make object! [a: 1 b: 2] >> c: context…
Pep
  • 451
  • 2
  • 9
5
votes
2 answers

Comparing characters in Rebol 3

I am trying to compare characters to see if they match. I can't figure out why it doesn't work. I'm expecting true on the output, but I'm getting false. character: "a" word: "aardvark" (first word) = character ; expecting true, getting false
beeflobill
  • 317
  • 1
  • 10
5
votes
3 answers

Is there an equivalent to "continue" (python) in rebol?

I am converting some python code to rebol, and I just came across a "continue" instruction. It interrupts the processing of a loop, going to the next iteration of the loop. I find this word quite elegant and readable. I came across some answers…
Pierre
  • 530
  • 5
  • 13
5
votes
2 answers

How do I get the remote IP-Address of clients connecting to a Rebol3 based server?

I'm playing with these basic TCP test scripts and would like to know: "How to get the IP-Address of clients connecting to the server?" Any ideas? I tried to probe a client subport at the server-side, but it doesn't show the remote-ip. Can someone…
TGD
  • 175
  • 1
  • 5
5
votes
3 answers

Evaluating a "variable variable"

I'm creating a dynamic variable ("Variable variable" in PHP parlance) with the following: foo: "test1" set to-word (rejoin [foo "_result_data"]) array 5 But how do I get the value of the resulting variable named "test1_result_data" dynamically? I…
Darrell Brogdon
  • 6,843
  • 9
  • 47
  • 62
5
votes
3 answers

Interleave blocks, or make object out of two blocks (field names and values)

Instead of creating objects by writing: obj: object [ name: "Fork" id: 1020 ] I'd like to write something like... obj: something-or-another [name id] ["Fork" 1020] ...and get the same result. An ideal solution would also permit: obj:…
5
votes
2 answers

Is there a function to decode encoded unicode utf-8 string like from a form?

I want to store some data with a html form and Rebol cgi. My form looks like this:
Input:
But for unicode…
Wayne Cui
  • 835
  • 7
  • 15