• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp917
r3wp9345
total:10262

results window for this page: [start: 153 end: 252]

world-name: r4wp

Group: #Red ... Red language group [web-public]
DocKimbel:
22-Aug-2012
I don't receive notification emails anymore for the newly added github 
issues...If I activate Settings->Notification->Watching->Email, I 
get them again, but also from all others repo I'm watching...Is there 
a way to only get the notifications by email for the repos I'm owning?
MagnussonC:
23-Aug-2012
I don't get any output, just a question if I'm allowing to open a 
port for read/write ...
Pekr:
23-Aug-2012
I might try to compile the library myself. How do I get different 
branch onto my PC?
DocKimbel:
23-Aug-2012
How do I get different branch onto my PC?

 If you're using TortoiseGit client, just search in the context menu 
 for "Switch/Checkout", then select the `dyn-lib-emitter`branch. If 
 you don't have it, you need to click on "..." button and create a 
 remote to dockimbel/dyn-lib-emitter.
DocKimbel:
23-Aug-2012
Ah ok, the info you get there are Windows file metadata (probably 
a resource section in the file), these are not from DLL core structures.
DocKimbel:
23-Aug-2012
Pekr: I wonder if there's not an issue with the lack of entry point 
in the DLL, I just don't get why REBOL would choke on it sometimes 
and never the C apps (except your testing tool).
Pekr:
23-Aug-2012
I will better redownload .zip archive. Is there any way how to get 
link to particular branch, so that I can keep my working directories 
intact and not mix a stuff from various branches into one directory?
DocKimbel:
23-Aug-2012
Pekr: be sure to get the lastest commit (pushed a minute ago).
DocKimbel:
23-Aug-2012
Would be nice if more ppl on Windows could test it, so we maybe get 
a clue why it doesn't load on 
some configs.
DocKimbel:
24-Aug-2012
Pekr and Rebolek: could you try to use ProcessMonitor (PM) to see 
if we can get a clue about what is blocking the DLL loading from 
R2?


1) Download it from: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
2) Run it

3) Open a REBOL console and CD to the folder where the DLL is located

4) In PM, drag'n drop the "target" icon to the REBOL console window
5) Type in console: lib: load/library %temp.dll

6) Scroll down in the PM window to look for rebol.exe process entries, 
look for failure reports in Result and Detail columns...
DocKimbel:
25-Aug-2012
If it still doesn't work, we'll have to get your hands dirty by diving 
in Windows guts using WinDbg. ;-)
Pekr:
25-Aug-2012
I mean - now we can make wrapper libs, coding almost in REBOL (syntax), 
no need to become dirty with C, and hence get more libraries to work 
with R2, via a wrapper libraries written in Red/System?
Robert:
25-Aug-2012
yes, to get one binary.
DocKimbel:
25-Aug-2012
For static libs linking, if someone could contribute by providing 
a .lib and .a file reader/parser, that would help get that feature 
implemented sooner.
Pekr:
25-Aug-2012
some kind of brige is required, if we want to get into an Android 
API. Ditto for .NET?
Robert:
27-Aug-2012
Porting / binding R3 GUI to Red shouldn't be hard to do. It's a lot 
of work but we would get a simple and fast to use GUI. One of the 
major USPs of Rebol. I don't know any other simple to use interpreter 
that gives you a GUI out of the box. And, in these app days, it's 
no longer so critical to support native look & feel in all aspects.
DocKimbel:
28-Aug-2012
The callback attribute is added automatically to a function when 
passed as get-word. But there are some cases where  it needs to be 
manually set, like for the ***-dll-entry-point function from the 
runtime.
DocKimbel:
4-Sep-2012
There are still a lot of details to work on, but the core part is 
there. The bootstrapping does had several complications (like literal 
series handling) that will vanish once we get Red compiler rewritten 
in Red.
BrianH:
4-Sep-2012
There is a bit that is worth learning from R3's Unicode transition 
that would help Red.


First, make sure that strings are logically series of codepoints. 
Don't expose the internal structure of strings to code that uses 
them. Different underlying platforms do their Unicode APIs using 
different formats, so on different platforms you might need to implement 
strings differently. You don't want these differences affecting the 
Red code that uses these strings.


Don't have direct equivalence between binary! and string! - require 
conversion between them. No AS-STRING and AS-BINARY functions. Don't 
export the underlying binary data. If you do, the code that uses 
strings would come to depend on a particular underlying format, and 
would then break on platforms where the underlying format is different. 
Also, if you provide access to the underlying binary data to Red 
code, you have to assume that the format of that data can be corrupted 
at any moment, so you'll have to add a lot of verification code, 
and your compiler won't be able to get rid of it.


Work in codepoints, not characters. Unicode characters are complicated 
and can involve multiple codepoints, or not, but until you display 
it none of that matters.


R3 uses fixed-length encodings of strings internally in order to 
speed things up, but that can cause problems when running on underlying 
platforms that use variable-length encodings in their APIs, like 
Linux (UTF-8) and Windows/Java/.NET/OSX? (UTF-16). This makes sense 
for R3 because the underlying code is compiled, but the outer code 
is not, and there's no way to break that barrier. With Red the string 
API could be logical, with the optimizer making the distinction go 
away, so you might be able to get away with using variable-length 
encodings internally if that makes sense to you. Length and index 
would be slower, but there'd be less overhead when calling external 
API functions, so make the tradeoff that works best for you.
BrianH:
4-Sep-2012
However, the part of the concurrency model that was designed so far 
affected the design and implementation of the system model and module 
system. You'd be surprised how much the module system was affected 
by the system, binding and interpretation model of R3; very little 
of its design and implementation was arbitrary. You might be able 
to get the syntax the same for Red's module system, but given the 
different system/binding/execution model there wouldn't be much of 
the implementation in common.
BrianH:
4-Sep-2012
One hypothetical advantage you have with Red is that you can make 
the logical behavior fairly high-level and have the compiler/optimizer 
get rid of that at runtime. REBOL, being interpreted, is effectively 
a lower-level language requiring hand optimization, the kind of hand 
optimization that you'd want to prohibit in Red because it would 
interfere with the machine optimization. This means that, for strings 
at least, it would make sense to have the logical model have a lot 
of the same constraints as that of R3 (because those constraints 
were inherent in the design of Unicode), but make the compiler aware 
of the model so it can translate things to a much lower level. If 
you break the logical model though, you remove the power the compiler 
has to optimize things.
BrianH:
4-Sep-2012
If you support different internal string encodings on a given platform, 
be sure to not give logical access to the underlying binary data 
to Red code. The get/set-modes model is good for that kind of thing. 
If the end developer knows that the string will be grabbed from something 
that provides UTF-8 and passed along to something that takes UTF-8, 
they might be better off choosing UTF-8 as an underlying encoding. 
However, that should just be a mode - their interaction with the 
string should follow the codepoint model. If the end developer will 
be working directly with encoded data, they should be working with 
binary! values.
DocKimbel:
4-Sep-2012
Brian: implementing an abstraction layer over string encodings is 
a trivial task. The intended datatype model is very similar to REBOL's 
one, even more since recentl,y as I moved to an hybrid dynamic/static 
type system. I'll commit the new code in a few days, so you'll see 
how close to REBOL it can be.


I hope that this hybrid model will help us get the best of both worlds.
Janko:
5-Sep-2012
Wow!!! awesome .. from print "hello worl" to print "<html>...</html>" 
to make webapps is not that long way, I was just afraid you would 
never get to RED, Awesome!
Arnold:
8-Sep-2012
Thery are called nono-credits because everywhere you want to exchange 
them you get to hear "nono"
Arnold:
8-Sep-2012
I do not bother to obtain bitcoins. Vague draining of computational 
powers of my tiny computer to compute some hashes(????) to unknown 
benefit to get by chance(???) ome 50 bitcoins of a limited(who controles 
this, I have serious doubts here too) supply of them. I am a real 
bitcoin sceptic, sorry. But again I think the Red group is not the 
place to discuss this matter, not that I have much more to say about 
this.
Arnold:
8-Sep-2012
About the paypal issue I have the same doubts about paypal as well, 
for this 2500 Euro limit is (I do not get any gifts) really restricting, 
when going to a bank that cooperates with the paypal organisation, 
you can set up a business account where you are no longer bound by 
this limit but then 'you' need to become a business.


Yes you can just exchange your currency, but there was NO return 
prestation delivered for the original bitcoin.
Janko:
10-Sep-2012
Doc, Services like Plimus or Fastspring probably have option to get 
you wire transfer or at least check (or some send you prepayed visa). 
Not eactly meant for your case, but if you don't find anything else. 
You could (I hope) make a "products" with them and then. I used them 
for similar transactions when nothing else could come into play. 
Paypal wasn' working here either and even now it's very clunky to 
retrieve the $$ from it.
Kaj:
13-Sep-2012
I'm looking for the first "trivial to implement" to get started as 
quickly as possible
sqlab:
14-Sep-2012
I would prefer Red to compile either to the directory, where the 
source is by default or at least not to the system/options/home path, 
but to the path I get with pwd
DocKimbel:
14-Sep-2012
I got math ops for integers working, but I think it's time we get 
a better macro system.
DocKimbel:
15-Sep-2012
Pekr: I had fun too working on low-level with Red/System, but it 
takes a lot of energy while working at Red level is a lot more relaxing. 
;-)


But this is short holidays, once Red gets mature enough (I bet on 
a couple of months), we'll start working on Red/System v2 (rewritten 
in Red, with a new compiler & linker architecture). This will give 
up the opportunity to reboot Red/System, fix a few design decisions 
if required, extend it, and get a clean and lean new code base in 
Red. I plan to write some architectural specs about the target compiler 
before starting, so all contributors will be able provide me with 
feedback before we implement it. Trust me, you _will_ like the final 
compiler! ;-)
DocKimbel:
15-Sep-2012
Ashley: that point is closer than you might think. Even at bootstrapping 
stage, once Red get enough Core features, you and any other reboler 
will be able to add new libraries or port existing one from REBOL 
(should be trivial in most cases). That's not limited to mezz code 
though, you'll be able to add bindings to pretty much anything, protocols, 
provide Red plugins for 3rd-party apps (browsers e.g.), even make 
a View clone if you want (that one could even be a community project). 
:-)
NickA:
15-Sep-2012
Has anyone here worked with OAuth and/or the etzy.com API in REBOL? 
 I'm currently looking through Christopher Ross-Gill's OAuth implementation 
for Twitter, and interested in writing a REBOL app using the etzy.com 
API.  I understand most of it, but don't get the "oauth_signature" 
spec.  Don't have much time for this, so would like to offer some 
$$$ for anyone able to instruct and or provide help implementing 
the etsy API.  Email reverse "g r o  tod  z r a t i u g  ta  codmorf"
Arnold:
15-Sep-2012
Please remember we want to contribute but without a reasonable clue 
this is hard to do. (Besides the closed-source issue this is what 
Carl ran into when expecting others to contribute). Me and Github 
wil never become friends for example, I managed to get some source 
long ago but no clue how to update to the newest sources and github 
has informed me they do not wish to support their macosX tool for 
Leopard that I am running, nor remove the useless (?) check on OS 
number 10.5, and I am NOT updating my system and learning all the 
commandlines to upgrade etc is too much effort, (maybe someone can 
build a REBOL interface).
Kaj:
15-Sep-2012
Note that you need to get the system page size with sysconf():
DocKimbel:
15-Sep-2012
Syscalls: given how much a programming language has to call OS services, 
I don't see why we shouldn't try to avoid an unnecessary layer. But 
I'm pragmatic, if we get more troubles than benefits, we'll adopt 
a more classical approach.
GrahamC:
15-Sep-2012
It would be nice if we had something like apt-get to fetch and update 
both yours and 3rd party software
Pekr:
17-Sep-2012
just one link - to the github red site ... then user should orientiate 
himself there ... nowadays visiting Red-lang.org does not suggest 
clearly, where one could get Red to give it a try ....
Pekr:
17-Sep-2012
But - sort your priorities yourself, no reason to get distracted 
....
Kaj:
17-Sep-2012
It's worse than that. The first error I get is on one of my #define's 
that's a struct! later in Red
DocKimbel:
19-Sep-2012
I've been very busy since yesterday on a new tool for Red: I've built 
a proper REBOL code profiler! (I wonder why I haven't done that since 
a long time...). I went through the profiler scripts on rebol.org 
and couldn't one suitable for my needs or that works with complex 
code, so I wrote one. It is able to deal with complex code, all datatypes, 
recursive calls and it's very simple to use.


Here's a demo profiling Red compiler (output is properly aligned 
when monospace font is used):

-= Red Compiler =-
Compiling red/tests/test.red ...

...compilation time:     40 ms

Compiling to native code...

...compilation time:     10189 ms
...linking time:         60 ms
...output file size:     37888 bytes
>> profiler/report/time


Function                       Count      Elapsed Time         % 
of ET

------------------------------------------------------------------------

compile                        1          0:00:10.249          100.0

comp-dialect                   205        0:00:09.659          94.24

fetch-expression               7505       0:00:09.628          93.94

comp-word                      5668       0:00:08.209          80.09

fetch-into                     427        0:00:07.519          73.36

comp-assignment                597        0:00:07.049          68.77

run                            3          0:00:06.492          63.34

comp-context                   21         0:00:06.398          62.42

comp-with                      1          0:00:05.565          54.29

comp-expression                3172       0:00:04.479          43.70

ns-find-with                   24277      0:00:03.962          38.65

finalize                       1          0:00:03.327          32.46

comp-natives                   1          0:00:03.274          31.94

comp-func-body                 180        0:00:03.271          31.91

comp-call                      2775       0:00:02.732          26.65

comp-func-args                 2861       0:00:01.862          18.16

find-aliased                   9650       0:00:01.86           18.14

resolve-type                   8032       0:00:01.799          17.55

get-type                       10758      0:00:01.546          15.08

ns-prefix                      21765      0:00:01.518          14.81

check-enum-symbol              7509       0:00:01.241          12.10

comp-block                     283        0:00:01.05           10.24

comp-variable-assign           417        0:00:01.034          10.08
Kaj:
22-Sep-2012
Their stance is clear. The whole world has already complained, so 
this is what you get
Pekr:
23-Sep-2012
I don't understand following syntax - is that just a word? 

s: GET_BUFFER(data)
Pekr:
23-Sep-2012
Then I am dumb - R2 does not allow being it a word, nor is it a function 
... so, what's that? Well, some tests, uh, surprised :-)

>> GET_BUFFER: [1 2 3 4 5]
== [1 2 3 4 5]
>> GET_BUFFER: [1 2 3 4 5](escape)
>> data: 4
== 4
>> GET_BUFFER(data)
== 4
>> GET_BUFFER/:data
== 4
DocKimbel:
23-Sep-2012
>> [GET_BUFFER(data)]
== [GET_BUFFER (data)]

;-)
Arnold:
23-Sep-2012
Pekr maybe try this instead of with 1 2 3 4 5 
>> GET_BUFFER: [a b c d e]
== [a b c d e]
>> data: 4
== 4
>> GET_BUFFER(data)
== 4
>> GET_BUFFER/:data  
== d
>> GET_BUFFER/(data)
== d
GrahamC:
23-Sep-2012
how to get a free license for any of their listed products http://www.atlassian.com/software/views/open-source-license-request
GrahamC:
24-Sep-2012
Agree something is needed ... there is no easy guide to get started
Arnold:
24-Sep-2012
The next step would than be to get the REPL for Red.
BrianH:
24-Sep-2012
I'm talking about eventually, when/if you get real runtime word types 
:)
Pekr:
26-Sep-2012
I don't get any chars for Chinese, and in the Greek string third 
char is incorrect too ...
Pekr:
26-Sep-2012
going to lunch, willing to debug, if I can get any instructions ....
DocKimbel:
26-Sep-2012
third char in Greek HelloWorld is still not resolved ...
 What do you get instead of the "i"?
Pekr:
26-Sep-2012
doc - in the greek case I get just a square ...
Pekr:
26-Sep-2012
Not yet ... deleting all the repository. I deleted hello.red, and 
no way I can get tortoisegit to get it sync - it just keeps telling 
me I am uptodate
DocKimbel:
26-Sep-2012
Are you sure you're not using Lucida? When I switch to Lucida, I 
get that 3rd greek character issue.
BrianH:
28-Sep-2012
The one thing R3 was bereft in was custom conversion functions. We 
had some ideas, but for the most part didn't get around to implementing 
them.
Pekr:
29-Sep-2012
well, as for BB 10 - we should get there imo - QNX based, old Amiga 
friends :-) And maybe it is good to support lower market, than crowded 
iOS developer's base? We will see ...
BrianH:
29-Sep-2012
Agreed. And it will be easier to keep an API clone updated for future 
SQLite changes, so we can get the benefits of future improvements 
to the storage engines.
kensingleton:
1-Oct-2012
Hi guys - I am trying out Red/System and all seems very good until 
I try out Kaj's fibonacci and mandelbrot functions. I downloaded 
the c-library -sorted the paths and locations and tested the library 
on simple things and all compiles well. When I try to compile fib 
and mandel I get the following compilation error:
kensingleton:
1-Oct-2012
Kaj, downloaded the Zip file from Fossil and re-ran (after sorting 
paths to files) and get the same problem as already posted. The problem 
is not file locations as that results in a different compiler error 
which is easily sorted. It seems to me in the problem I have posted, 
the compiler thinks there is already an alias called str-array! - 
however I have searched every reds file and there is no other with 
that name! Anyway, it is not urgent but I just wanted to feed back 
my findings to you.
Group: Ann-Reply ... Reply to Announce group [web-public]
Rebolek:
2-Jul-2012
ah, now I get your error. Maybe Arnold changed something in the code?
Henrik:
16-Jul-2012
No, this was an old effort for Saphirion to get access to the source 
code privately. It didn't work.
Henrik:
16-Jul-2012
It's too early to get hopes up. The restrictions may be quite severe 
(NDA and such).
Andreas:
17-Jul-2012
For both, R2 and R3, you can use HELP on a console to get a listing 
of all global values of a certain type. So to see all functions, 
try
>> HELP function!
Endo:
26-Jul-2012
I've an issue with RebolIDE,

I get "Script Error: Face object reused (in more than one pane): 
Example..."

Here is the steps to reproduce: open shape document from help menu, 
click on an example (opens a new window), close the example window 
and the document window, then click on help menu.
Great work by the way, I especially like the documents.
Arnold:
26-Jul-2012
Get the error too, just downloaded 10 minutes ago. ** Script Error: 
Face object reused (in more than one pane): Binds words to a specified 
context
** Where: set-focus
** Near: show face
After closing the help core
Group: Rebol School ... REBOL School [web-public]
GrahamC:
27-Aug-2012
Sure we have various idioms that people get used to using, but that's 
not the same thing
Endo:
28-Aug-2012
map-each [x: y] [...] is an interesting use. I sometimes needed to 
get that "index" value but I didn't know that usage so I used forall 
instead. Good to learn.
DocKimbel:
28-Aug-2012
In your first try (bind 'e self), you're binding only this 'e word, 
not the :e function body, so if you replace it with: bind second 
:e self, it will work.


In second try, you're never binding 'e function body, you've just 
binded a new instance of 'f word that you have created using FIRST. 
That's why it works when you add DO, you're evaluating that new 'f 
instance which has the correct binding. Just remove FIRST, it will 
bind 'e body block and you'll get the result you've expected.

>> e: func [] [f]
>> o: context [f: does [print "ok"]]
>> bind second :e o
== [f]
>> e
ok
Endo:
28-Aug-2012
Got it, thanks a lot. I didn't know that FIRST gives me a "new" word, 
I thought that I'm BINDing *the* word itself and it should stay BINDed.

This confused me a bit:
>> o: context [a: 1 b: 2 c: 3]

>> foreach x bind [a b c] o [probe get x] ;this works, BINDs block 
to O

>> foreach x [a b c] [probe get bind x o] ;this works too, BINDs 
the word 'X to O
BrianH:
28-Aug-2012
Endo, when you are using set-words with MAP-EACH and R3's FOREACH, 
be sure to include at least one regular word, or it won't advance 
and you'll get an endless loop. We made that possible in order to 
support the foreach [x:] data [... take x ...] code pattern. It's 
the type of thing that would generate a warning in other languages, 
but REBOL is inherently incompatible with warnings.
caelum:
5-Sep-2012
A beginners question. I have some code that allows a user to input 
a date or leave it blank;

datetime: field

I get the data by accessing;

datetime/text


My question is, if the user leaves the field empty, how do I test 
for this? I have tried none? And empty?

If none? datetime/text [print "Select a date"]


produces a Script Error: 'datetime has no value'. How do I test if 
datetime/text is null so I can ask the user to go back and fill in 
the datetime field?
GrahamC:
5-Sep-2012
you get that vid error because you are referring to it before the 
layout function has run.
Arnold:
7-Sep-2012
Hi I am trying to replicate this in Rebol: http://www.alistapart.com/articles/succeed/
I have the redirect setup but I want to know what url the user entered. 
Where can I get $DOCUMENT_ROOT.$REQUEST_URI ??
DocKimbel:
7-Sep-2012
If you are using REBOL in CGI mode:

    get-env "DOCUMENT_ROOT"
    get-env  "REQUEST_URI"
Arnold:
7-Sep-2012
Thank you, this works! I found and old conversation on ALTME this 
afternoon but that could not convince me being the answer, this answer 
will replace the old one. (I even typed get_env the first time). 
And for completeness I will write how to use it (cut and paste code) 
requestedurl: get-env "REQUEST_URI"
Arnold:
7-Sep-2012
And the next step get-env "SCRIPT_FILENAME" 
guess I will have to post the complete script when I finish it.
Arnold:
11-Sep-2012
Found some code/documentation about playing a sound (wav) on www.rebol.com/docs/sound.html 
 

but although rebol/view 2.7.8 (Win XP) has Sound 1.4.0 on board it 
seems using the sound:// port is reserved for use by the SDK version? 
** Access Error: Cannot open sound
** Where: halt-view
** Near: sound-port: open sound://
on MacOSX I get
** Access Error: Invalid port spec: sound://
** Where: halt-view
** Near: sound-port: open sound://

But that is less surprising since there is no Sound module available 
there.
So what is Sound (1.4.0) about?
BrianH:
13-Sep-2012
There was a plan to make device extensions, but Carl didn't know 
what API to use. He did a callout for advice, but that didn't get 
much response.
Gregg:
16-Sep-2012
Will this work?

    LPINT-def: [value [integer!]] none
    LPINT: make struct! LPINT-def none

    make-LPINT: does [make struct! LPINT-def none]

    get-dereferenced-data: func [

        {Given a pointer to memory, copy the target data into a REBOL struct.}
        pointer [struct!]   "LPINT structure"

        struct-def [block!] "Contains a sub-struct that is the real struct 
        you want."
        /local struct data orig-pointer result
    ] [

        struct: make struct! compose/deep/only [ ; make wrapper struct
            sub [struct! (struct-def)]
        ] none

        orig-pointer: third struct              ; store original inner pointer

        change third struct third pointer       ; change inner pointer to 
        ref'd data

        data: copy third struct/sub             ; copy data from the inner 
        struct
        ;print mold data

        change third struct orig-pointer        ; restore inner pointer

        result: make struct! struct-def none    ; make result struct

        change third result data                ; change data in result struct
        ;probe result
        struct: data: orig-pointer: none
        ;recycle
        result
    ]

It's from some old code, so no guarantees.
Gregg:
16-Sep-2012
Also, get-dereferenced-data maps the buffer into another REBOL struct. 
If you just want the binary data, you can adapt it not to do that.
Marco:
16-Sep-2012
ok it seems to work. it becomes:

 integer-address: get-address "hello" ; function courtesy of Anton 
 Rolls
	pointer: make-LPINT
	pointer/value: integer-address
	probe third get-dereferenced-data pointer [l1 [int] l2 [int]]
NickD:
23-Sep-2012
There has to be something Rebol is doing beyond a simple language 
api to get level of security purported by Carl. 
What kind of pipes does it use?
MarcS:
3-Oct-2012
that was originally _args_ but i switched it out so that you could 
get a more readable recur call (i.e., cheekily make use of 'with' 
so that it read better)
Gregg:
3-Oct-2012
Ah, no, I think I get it now.
Steeve:
3-Oct-2012
It's Rebol School group here. Why would your post be a pollution 
? I don't get it
Ladislav:
3-Oct-2012
OK, this is the long version:

tail-func: func [
    {

  Define a recursive user function with the supplied SPEC and BODY.
     	The function can use a special TAIL-CALL local function
     	to perform a tail-recursive function call.
    }
    [catch]


 spec [block!] {Help string (opt) followed by arg words (and opt type 
 and string)}
    body [block!] {The body block of the function}
    /local the-function tail-call context-word
] [
	; define a new 'tail-call local variable
	tail-call: use [tail-call] ['tail-call]
	
	; bind the given BODY to "know" the 'tail-call variable
	body: bind/copy body tail-call
	
	; find a local word in SPEC
	context-word: find spec word!
	if context-word [context-word: first context-word]
	
	; define the TAIL-CALL function
	set tail-call func spec compose [
		(
			either context-word [
				; set parameters to the new arguments
				compose [set parameters values? (context-word)]
			] [[]]
		)
		throw/name none 'tail-call
	]
	
	; define the function
	the-function: throw-on-error [
		func spec compose/deep [
			(either context-word [context-word] [[]])
			while [true] [
				catch/name [
					return do [(body)]
				] 'tail-call
			]
		]
	]
	
	if context-word [
		; get the function context
		context-word: bind? first second :the-function
		
		; replace the context word in the function body by NONE
		change second :the-function none

		; adjust the TAIL-CALL body
		; replace the 'parameters word

  change/only at second get tail-call 2 bind first context-word context-word
	]

    :the-function
]

values?: func ['word] [second bind? word]
Steeve:
3-Oct-2012
yeah I see that the purpose is to get ride of the block passing style 
of the arguments, but it looks not anymore as simple
Steeve:
5-Oct-2012
;Go back to recur as a function.
;Still recur can't be used as a parameter, local or a refinement.

;This implementation is much more clean (no shitty compose/deep) 
and still very short.

;The collision of words is avoided by the use of singleton functions 
#[function!]
;I'm confident with this one. It could be the last one -_-;


rfunc: func [[catch] spec [block!] body [block!] /local ctx args][
    ctx: bind? first second throw-on-error [
        ;* Temporary function created to retrieve parameters
        ;* and to get a new context for 'recur.
        ;* The context will remain alive (not GC'ed).
        func append copy spec /recur [recur]
    ]
    args: bind to-block form first ctx ctx
    ctx/recur: func spec reduce [

        quote #[function! ['word] [throw/name second bind? word 'recur]] 

        first args ;* may be 'recur if empty specs (still, it's ok)
    ]
    func spec reduce [
        quote #[function! [args body][

            while [true][set/any args catch/name [return do body] 'recur]
        ]] 
        head remove back tail args ;* remove 'recur
        bind/copy body ctx         ;* bound 'recur
    ]
]
Steeve:
5-Oct-2012
;Go back to recur as a function.
;Still recur can't be used as a parameter, local or a refinement.

;This implementation is much more clean (no shitty compose/deep) 
and still very short.

;The collision of words is avoided by the use of singleton functions 
#[function!]
;I'm confident with this one. It could be the last one -_-;


rfunc: func [[catch] spec [block!] body [block!] /local ctx args][
    ctx: bind? first second throw-on-error [
        ;* Temporary function created to retrieve parameters
        ;* and to get a new context for 'recur.
        ;* The context will remain alive (not GC'ed).
        func append copy spec /recur [recur]
    ]
    args: bind to-block form first ctx ctx
    ctx/recur: func spec reduce [

        quote #[function! ['word] [throw/name second bind? word 'recur]] 

        first args ;* may be 'recur if empty specs (still, it's ok)
    ]
    func spec reduce [
        quote #[function! [args body][

            while [true][set/any args catch/name [return do body] 'recur]
        ]] 
        head remove back tail args ;* remove 'recur
        bind/copy body ctx         ;* bound 'recur
    ]
]
Ladislav:
5-Oct-2012
Rebol [
    Title: "Catch"
    File: %catch.r
    Date: 5-Oct-2012/17:49:58+2:00
    Author: "Ladislav Mecir"
    Purpose: {
    	Catches local throw'
    	Ignores non-local throws
    }
]

; Error definition
system/error: make system/error [
	throw': make object! [
		code: system/error/throw/code + 50
		type: "throw' error"
    	not-caught: ["throw' not caught"]
    ]
]

catch': func [
    {Catches a throw' from a block and returns the value.}
    [throw]
    block [block!] "Block to evaluate"
    /local err disarmed
] [
	use [throw'] copy/deep compose/only [
		; "localize" 'throw' in the block
		block: (block)

		throw': func [[catch] value [any-type!]] [
			disarmed: disarm err: make error! [throw' not-caught]
			set/any in disarmed 'arg1 get/any 'value
			disarmed/arg2: 'throw'
			throw err
		]

		get/any either all [
			error? set/any 'err try block
			(
				disarmed: disarm err
				disarmed/type = 'throw'
			)
			disarmed/id = 'not-caught
			disarmed/arg2 =? 'throw'
		] [
			in disarmed 'arg1
		] [
			'err
		]
	]
]
Steeve:
5-Oct-2012
; Sorry Ladislav I've stolen your idea one should avoid catch/throw 
interferences

; As an extra (also your idea ?), f/recur and recur are now both 
allowed.

rfunc: func [[catch] spec [block!] body [block!] /local ctx fun][
    ctx: bind? take second fun: throw-on-error [
        func append copy spec /recur reduce ['recur body]
    ]
    insert second :fun reduce [

        quote #[function! [[throw] ctx args 'fun body /local ret][

            if :ctx/recur [ctx/recur: ctx throw/name second ctx 'recur]
            ctx/recur: :fun
            while [true][
                set/any 'ret catch/name [return do body] 'recur

                unless all [value? 'ret block? :ret same? ctx last ret][
                    throw/name get/any 'ret 'recur
                ]
                set/any args ret
            ]
        ]]

        ctx (bind head remove back tail to-block form first ctx ctx) :fun
    ]
    :fun
]
Steeve:
5-Oct-2012
; Ladislav I can't see if you posted new code (WTF Altme)

; So I've tried your idea one should avoid catch/throw interferences

; As an extra (also your idea ?), f/recur and recur are now both 
allowed.

rfunc: func [[catch] spec [block!] body [block!] /local ctx fun][
    ctx: bind? take second fun: throw-on-error [
        func append copy spec /recur reduce ['recur body]
    ]
    insert second :fun reduce [

        quote #[function! [[throw] ctx args 'fun body /local ret][

            if :ctx/recur [ctx/recur: ctx throw/name second ctx 'recur]
            ctx/recur: :fun
            while [true][
                set/any 'ret catch/name [return do body] 'recur

                unless all [value? 'ret block? :ret same? ctx last ret][
                    throw/name get/any 'ret 'recur
                ]
                set/any args ret
            ]
        ]]

        ctx (bind head remove back tail to-block form first ctx ctx) :fun
    ]
    :fun
]
Steeve:
5-Oct-2012
; Ladislav I can't see if you posted new code (WTF Altme)

; So I've tried your idea one should avoid catch/throw interferences

; As an extra (also your idea ?), f/recur and recur are now both 
allowed.

rfunc: func [[catch] spec [block!] body [block!] /local ctx fun][
    ctx: bind? take second fun: throw-on-error [
        func append copy spec /recur reduce ['recur body]
    ]
    insert second :fun reduce [

        quote #[function! [[throw] ctx args 'fun body /local ret][

            if :ctx/recur [ctx/recur: ctx throw/name second ctx 'recur]
            ctx/recur: :fun
            while [true][
                set/any 'ret catch/name [return do body] 'recur

                unless all [value? 'ret block? :ret same? ctx last ret][
                    throw/name get/any 'ret 'recur
                ]
                set/any args ret
            ]
        ]]

        ctx (bind head remove back tail to-block form first ctx ctx) :fun
    ]
    :fun
]
Steeve:
5-Oct-2012
This time it's really really my final version T_T
- Both f/recur and recur allowed
- Catch/throw interferences ok.

NB: The code would be simpler in R3 since several workarounds are 
used to correct misbehaviors of object related natives of R2.

Also the lack of the reflexive capability for a function to read 
its own context in a easy way is definitivly a huge miss.

(On can't create anonymous functions without analysing their specs 
first. What a pain)

One would need a reserved word holding the context (like SELF for 
objects).

These shortcomings are making the code too much obfuscated and huge 
for my taste.
I hope it will be corrected in R3..

rfunc: func [
    [catch] spec [block!] body [block!] 
    /local ctx args call-tail
][
    ctx: bind? first second throw-on-error [
        func spec: append copy spec /recur [recur]
    ]
    args: bind head remove back tail to-block form first ctx ctx
    call-tail: func ['word] compose/deep [
        set/any [(args)] second bind? word 
        throw/name (ctx) 'recur
    ]
    ctx/recur: func spec reduce [:call-tail 'recur]
    func spec reduce [
        quote #[function! [
            [throw] 'recur 'call-tail ctx args body /local ret
        ][
            if get/any recur [call-tail :recur]
            set recur get in ctx 'recur
            while [true][
                set/any 'ret catch/name [return do body] 'recur
                unless all [value? 'ret same? :ret ctx][
                    throw/name get/any 'ret 'recur
                ]
                set/any args second ctx
            ]
        ]]
        'recur :call-tail ctx args body
    ]
]
Arnold:
7-Oct-2012
That is a idea. The text to emphasize is the text that you get to 
read. Then it disappear and you have to type it yourself. It is a 
progam from a schoolprogram for young children. I want to replicate 
it and maybe add a little fun for my daughter thinks it is boring 
as it is now.
Sunanda:
7-Oct-2012
Does this get close?
   http://www.rebol.org/view-script.r?script=render-rich-text.r
Sujoy:
10-Oct-2012
so i copied the files over to a new directory, then when i try
>> do %uni-engine.r
>> uniserve/boot
...i get a bunch of errors saying cheyenne is not defined


using the old (0.99) sources on the softinnov website, i can use 
the starter.r script just fine. However, i set up a simple service 
and a module to process tasks, but get:

** Script Error: Cannot use path on none! value
** Where: process-task
** Near: if shared/pool-max > shared/pool-count [
    fork
    if verbose > 0 [log/info "launching new process"]
]
101 / 102621[2] 345...99100101102103