Questions tagged [red]

The Red language is inspired by the interpreted language Rebol, but is compiled and hence has a wider range of application...from device drivers to high-level purposes. It is functional, imperative and symbolic, with prototype-based object support. Like LISP and Rebol, it is homoiconic and thus its own meta-language. It is both statically and JIT-compiled to native code, with strong support for concurrency and parallelism (actors, parallel collections).

Red is a paradigm-neutral homoiconic language.

Red has a low memory footprint, and has a low disk footprint (< 1MB). Red seeks to be a "full-stack" language whose methodology is independent of any other toolchain. It's goal is to compile that which can be known ahead of time, JIT-compile that which cannot, and embeds a small interpreter into its executables to handle constructions which are not amenable to any compilation.

As an intermediate language (IL) Red uses a C-like language called . Red/System's parser is reused from Red itself...and for which it has its own code generators. The Red executable is able to build Red/System files directly (*.reds) as well as Red files (*.red), and Red/System code may be embedded freely in Red code.

248 questions
3
votes
1 answer

How do I make an `object!` from a `map!`

I have a map!: #(a: 1) and want to convert it to an equivalent object! like: [a: 1].
Dave Andersen
  • 5,337
  • 3
  • 30
  • 29
3
votes
1 answer

Red vid open window with maximize

When run this code, it will open the window with a default size: View [ text "window open with default size" ] If a give a size explicitly, it will open a window with that size: View [ size 400x400 text "window open with fixed…
3
votes
1 answer

Red vid modal window is opening more than one

View [ Size 400x400 button "click" [ view/flags [ Size 300x100 text "modal window" ]['modal 'pop-up] ] ] Problem is if I click button 4 times it will create 4 modal window. But I want no other…
3
votes
1 answer

Aligning buttons in column in Red

I am brand new to Red/Rebol. I love it so far, I am experimenting with the GUI system. I am trying to align some buttons in a vertical column so to speak. This is what I have so far Red [ Title: "Editor" needs: 'view] view [ size 800x600…
Alexander Ryan Baggett
  • 2,347
  • 4
  • 34
  • 61
3
votes
1 answer

Which are the cases that make it hard to distinguish between code and data?

It is said code is data (and vice versa, i.e. homoiconic) in Rebol and Red. Also, it is said that it's impossible to distinguish between the two. My understanding is that there are 2 cases here: Determine with certainty code from a mix of code and…
Geeky I
  • 751
  • 6
  • 22
3
votes
1 answer

How can I pass around a function with args, in red?

How can I pass a function as an argument in red? Or would I not need that in red? Using does I can define a function "with no arguments or local variables" f: does [print 1] do f >> 1 How can I make this work with (multiple) args? does is no the…
Wolfram Kriesing
  • 1,527
  • 10
  • 7
3
votes
1 answer

REBOL methods in Red

Disclaimer: What I'm trying to achieve is something like what was discussed here - Evaluating a "variable variable". I want to create variables in red dynamically with identifiers based on some parsed data. Examples from post above mention Rebol…
Bohdan Ivanov
  • 806
  • 9
  • 28
3
votes
1 answer

Rebol Quickstart

I've been meaning to try out rebol (or red). I think it might be the perfect fit for my next project. I've downloaded and tested out red 0.5.4, and REBOL/View 2.7(http://www.rebol.com/download-view.html) However, there are a couple of roadblocks for…
Geeky I
  • 751
  • 6
  • 22
3
votes
1 answer

load a map of hash - object key pair

Please consider this example where I save a map! to a file and want to load it back and access its keys and values. Its keys are hashes (INTEGER!, calculated by checksum) and its values are blocks: Rebol [] bl1: make object! [ name:…
Luis
  • 1,236
  • 5
  • 22
  • 31
3
votes
1 answer

Access word value inside object

In the interpreter: >> qurl: "1234" == "1234" >> R: make object! [probe qurl qq: qurl probe qq] "1234" "1234" == make object! [ qq: "1234" ] This behaves like I'd expect. All "variables" or "words" are global by default. Using a…
Luis
  • 1,236
  • 5
  • 22
  • 31
3
votes
1 answer

performing Network I/O in Red using bindings

I read that there were bindings to perform GET and POST in the Red programming language. Could someone kindly show me a simple example that does something like "wget http://www.google.com"?
Friendly Genius
  • 305
  • 3
  • 12
3
votes
3 answers

Understanding the relationship between print and symbols held in blocks

Scenario 1: red>> sizes: [small medium large] == [small medium large] red>> print sizes *** Script error: small has no value *** Where: print Scenario 2: red>> print first sizes small I expected scenarios 1 and 2 to have the same behaviour(either…
RAbraham
  • 5,956
  • 8
  • 45
  • 80
3
votes
3 answers

What are the rules about self-modifying parse rules in Rebol/Red?

I am looking at self-modifying rules and wondering what exactly the semantics are and how they would work at all. That's a pretty broad question, but I'll use a specific "how would I do this" to turn it into a more focused one. (^(64) being the…
3
votes
2 answers

How can I reverse-sort a list in Red?

I've been playing with Red, and I figured out how to sort a list: --== Red 0.5.1 ==-- Type HELP for starting information. red>> list: [1 9 6 8] == [1 9 6 8] red>> sort list == [1 6 8 9] I'd like to sort this list backwards. How can I do this?…
Undo
  • 25,519
  • 37
  • 106
  • 129
3
votes
2 answers

How to properly use the Red/System dialect from the pure Red code?

I am writing a simple tutorial application using curses binding to Red/System. Doing it like it is shown in "curses-example.reds" works great. But how can I use this binding from a pure Red code? Did I get the whole approach wrong and I really must…
Ivan Sukin
  • 85
  • 5