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
0
votes
3 answers

Read doesn't work with Wordpress.com pages

This is not the same question as Read https://google.com doesn't work anymore in Red? Even with the fix above, it doesn't work: convert-invalid: function [page] [ collect/into [foreach c page [keep to-char c]] clear "" ] convert-invalid…
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
1 answer

How to get the full source code of an Action in Red?

As I can see read is not native >> native? :read == false but when I tried to get the source code with write-clipboard mold :read I only got header of read make action! [[ "Reads from a file, URL, or other port" source [file! url!]…
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
1 answer

How can I change a global variable that have the same name as a local variable in Rebol or Red?

I cannot change the value of global variable a within f because it has the same name as a local variable: when function returns, a is still 1 instead of 12. a: 1 f: func[a][set 'a a] >> f 12 == 12 >> a == 1 How can I refer to global variable a ?…
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
1 answer

Is there a way to make a function like ask but which accepts multiple lines in Red console?

When using ask "your answer: " You cannot paste multiple lines. Is it possible to control the console to accept multiple lines temporarily ? Or am I obliged to create a GUI which I'd like to avoid, I don't want any GUI if possible.
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
1 answer

Is there a way to protect / unprotect a word in Red like in Rebol?

Protect/Unprotect exist in Rebol, they don't seem to exist in Red.
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
1 answer

Red to-date doesn't work with AAAA.MM.JJ

This code snippet works on Rebol: to-date "2017.08.29" but it doesn't work on Red Looking at the source seems the same. So why it doesn't behave the same way ? What to do ?
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
0 answers

Cannot read a binary file with red from http

write %test.zip read/binary https://sourceforge.net/projects/agena/files/latest/download?source=directory?SetFreedomCookie doesn't download the file because there is a redirect. Is there a way to tell to follow redirect before reading ?
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
1 answer

Call notepad doesn't work in rebol nor red on Windows 10

I type this in console: call "notepad.exe" It returns a number but notepad is not launched.
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
1 answer

Parse doesn't work for insertion after last line of some keyword

I want to insert new sentence under last line where keyword is found, but it doesn't work, seems simple at first: source: { bla bla bla bla bla bla bla bla bla bla keyword bla bla bla bla keyword bla bla …
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
2 answers

Processing block parameter with word types in red / rebol

When calling: f [(h test) (h test2)] I want to get: "

test

test2

" Instead I get: "

test2

" I can't see why my code below doesn't work. Note that I want to use g function below because I have several h like…
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
1 answer

Is it possible to generate function dynamically in rebol or red

Instead of hard coding (contrived example here): f1: func[][print "f1"] f100: func[][print "f100"] etc... Is it possible to do something like this for num 1 100 1 [ set to-word rejoin ["f" num] func[][ print rejoin…
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
1 answer

Rebol / Red Parse html rules returns true but nothing is inserted

I have a parse rules that returns true but it doesn't insert my text as expected : the html is unchanged whereas it should have inserted at the end of the main closing div. I tried to use a counter like How to parse inside HTML tags with…
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
1 answer

How to use rebol/red bind to pass a block argument to another function?

I don't really understand if it can be done with bind or anything else, the documentation http://www.rebol.com/docs/words/wbind.html doesn't help as for me. I want to pass block argument from f2 to f1 : f1: func[block][ foreach b block [ …
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
1 answer

rebol/red: Is there an elegant way to know if it is last item in foreach?

My code is clunky: length: length? items count: 0 foreach item items [ count: count + 1 if count = length [ print "last item" ] ] Is there something better ?
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
2 answers

How to use tab to move in a list of fields in Red language

This is similar to my earlier question ( Using TAB to move between fields in Red language ). Since I have many fields, I want to use a list of fields. However, following code is not working: Red [] view [ text "Value of x:" f1: field ""…
rnso
  • 23,686
  • 25
  • 112
  • 234