Questions tagged [rebol3]

A cross-platform data exchange language and a multi-paradigm dynamic programming language.

A cross-platform data exchange language and a multi-paradigm dynamic programming language designed by Carl Sassenrath for network communications and distributed computing.

207 questions
2
votes
2 answers

Write a block array of data to a file

I'm stuck on this after many attempts, I have an array of items and I'm trying to output this to a file but the problem is that it writes all at once and ignores newline. I'm beginning to wonder if rebol even has such a simple ability. file1.txt…
sgroves855
  • 153
  • 10
2
votes
2 answers

Print binary data to stdout using Rebol

I'm using Rebol to produce binary output, but the output is not what I expected. This is a simple test script, which prints all bytes from 0 to 255: REBOL[] for i 0 255 1 [ prin to char! i ] Execute the test like this: rebol -q test.rebol |…
psmith
  • 2,292
  • 1
  • 19
  • 19
2
votes
1 answer

Making a Hostkit Event in Rebol3

I'm making a Rebol 3 extension that has GUI events. For now, I manage this using synchronous callbacks so each time an event happens like a mouse move, the C extension calls the Rebol callback function. But I'd like to manage this using REBEVT and…
GregP
  • 85
  • 6
2
votes
1 answer

Object vs Block

I'm building a model to display a UI using SDL2 on Rebol3. So far, I'd like to do something like this: gui: copy [] append gui context [style: 'h1 at: 10x30 text: "Hello World!" font: arial] but should I use Object! when I only need a Block! like…
GregP
  • 85
  • 6
2
votes
2 answers

How to interpret stats/show in Rebol 3

Wanted to make some profiling on a R3 script and was checking at the stats command. But what do these informations mean? How can it be used to monitor memory usage? >> stats/show Series Memory Info: node size = 16 series size = 20 5…
GregP
  • 85
  • 6
2
votes
2 answers

Text and caret in VID or R3-Gui

A simple example: If I type #"w" in style "area" how do I get an #"z"? (ex. "qwerty ww" -> "qzerty zz")
noein
  • 411
  • 2
  • 10
2
votes
2 answers

Efficient way to fill an array with its own indices in Rebol3

What's a neat one-liner to fill an array (of given possibly dynamic size) with its own indices? I was trying this: data: copy {} repeat tilenum totaltiles [ append data rejoin [tilenum " "] ] ...and then looking to convert it into an array, but…
Kev
  • 15,899
  • 15
  • 79
  • 112
2
votes
1 answer

automatic label resizing in Rebol3 Saphir

I tried to improve the Tip Calculator example a bit, so that "Total: " doesn't disappear when you hit enter on the tip field: REBOL [title: "Tip Calculator"] view [ f: field "49.99" hpanel [ t: field "20" on-action [ …
Kev
  • 15,899
  • 15
  • 79
  • 112
2
votes
3 answers

How to avoid function invocation in COMPOSE-like circumstances?

In the following code, we can assign the result of a GET-WORD to p through a SET-WORD, and then use it under the new name: p: :print p [{Hello} {World}] But what if you are using COMPOSE, and you find a situation such as this? do compose [p:…
2
votes
1 answer

What's the most efficient way to decode a UTF16 binary?

As Rebol 3 supports unicode, and UTF16 is used internally when needed (if it has only ASCII characters, it's in ASCII), it should be as simple as copying the memory content from the binary and setting up the REBVAL structure. However, the only way I…
Shixin Zeng
  • 1,458
  • 1
  • 10
  • 14
2
votes
1 answer

error trying to run any simple r3-gui Rebol script but only when pre-downloaded

So I downloaded Saphir's Rebol 3 for 32-bit Linux (I have Mint 17). (As draegtun pointed out, no I didn't. They don't seem to offer a Linux version at the moment.) If test.r contains: load-gui view [text "Hello World!"] ...I get a window as…
Kev
  • 15,899
  • 15
  • 79
  • 112
2
votes
1 answer

Alternative rules in PARSE with SKIP only did not output expected results

I encounter a snippet of code: blk: [1 #[none] 2 #[none] 3 #[none]] probe parse blk [ any [ set s integer! (print 'integer) | (print 'none) skip ] ] the output is: integer none integer none integer none none true Note that in front…
Wayne Cui
  • 835
  • 7
  • 15
2
votes
2 answers

Partial read from urls with READ/PART or READ/SEEK

Partial read via HTTP Range header works fine for me: rebol [] client: open tcp://www.apache.org/ client/awake: func [event /local port] [ port: event/port switch event/type [ lookup [open port] connect [ write…
Wayne Cui
  • 835
  • 7
  • 15
2
votes
2 answers

How to break out of a subrule once a certain part of the rule is met?

Currently parsing Midi messages for the Firmata protocol in Rebol 3, and came across a situation I haven't seen before. Basically, I have a generic rule to copy bytes between the framing bytes. However that rule is eating the framing bytes. I have…
kealist
  • 1,669
  • 12
  • 26
2
votes
3 answers

Is it possible to pass parameters by reference in Rebol?

Here, I have attempted to set the value of a global variable from inside a function, but the value has not changed: setGlobalScope: func [theVar1] [ theVar1: 10 ] theVar: 1 setGlobalScope theVar print theVar "This prints 1 instead of 10. The…
Anderson Green
  • 30,230
  • 67
  • 195
  • 328