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

World: r4wp

[!REBOL3] General discussion about REBOL 3

Gabriele
10-Jan-2013
[437]
for example, synchronous operations are just a hack, they fail if 
you try to download a larger file as there is a time limit to the 
whole operation.
GrahamC
10-Jan-2013
[438]
And nearly 6 years ago
Gabriele
10-Jan-2013
[439]
yeah, time flies. :)
GrahamC
10-Jan-2013
[440]
Are you intending to do any more work on R3 now that it's OS?
Gabriele
10-Jan-2013
[441]
not in the short term, i don't really have time for it. no idea what 
happens long term. :)
GrahamC
10-Jan-2013
[442]
And Topaz?
Gabriele
10-Jan-2013
[443]
it's higher priority than R3 for me, but i'm not sure if i'll be 
able to work on it in the next 2-3 months. things should settle after 
that though, and hopefully i'll be able to plan again and carve some 
serious time for it.
Robert
10-Jan-2013
[444]
I can remember that Reb/Service got stuck because of some limitations 
of R3. Not which one it were. So, can we bring R/S back to life? 
Is it worth the effort?
AdrianS
10-Jan-2013
[445]
I don't recall - was there a big difficulty in reporting errors more 
accurately in Rebol? It would be nice to have a line number in a 
script. As it is the context given around the error is often pretty 
vague and doesn't help much.
Ladislav
10-Jan-2013
[446x2]
That has been discussed too many times. It's a pity you cannot find 
the discussing in some archive...
err: "discussion"
GrahamC
10-Jan-2013
[448]
Adrian, all errors occur in line 1.
AdrianS
10-Jan-2013
[449]
I remember some sort of discussion, but I think it was at least a 
couple of years ago on the REBOL3 world - can't log in there any 
longer.

Graham, what do you mean all occur in line 1?
GrahamC
10-Jan-2013
[450]
Joke, most rebol scripts are just a continuous stream of code, lines 
don't have any significance except for legibility
Henrik
10-Jan-2013
[451]
Line numbers don't make any sense. You want a good stack trace instead.
BrianH
10-Jan-2013
[452x3]
Chris, the easiest way to do what you are trying to do is to use 
sys/load-header, which returns a block of the decoded header object, 
the position of the script after the header (after decompressing 
it if need be), and the position after the whole script (useful for 
embedded scripts. If the script is embedded in a block it will decode 
the whole script and return the decoded block at the position after 
the header, but that can't be helped. R3 scripts are binary, not 
text, so the returned script position is binary.

>> sys/load-header "#!/some/path 1foo^/REBOL []^/script here"
== [make object! [
        title: "Untitled"
        name: none
        type: none
        version: none
        date: none
        file: none
        author: none
        needs: none
        options: none
        checksum: none
    ] #{7363726970742068657265} #{}]


>> to-string second sys/load-header "#!/some/path 1foo^/REBOL []^/script 
here"
== "script here"


Note that it will skip past one trailing newline after the header, 
if one exists.
The sys/load-header function is the same function that R3's LOAD, 
DO and IMPORT use to decode headers.
Here's an example of that script-in-a-block embedding I mentioned:


>> sys/load-header "#!/some/path 1foo^/[REBOL []^/script here] other 
stuff"
== [make object! [
        title: "Untitled"
        name: none
        type: none
        version: none
        date: none
        file: none
        author: none
        needs: none
        options: none
        checksum: none
    ] [
        script here
    ] #{206F74686572207374756666}]
Chris
10-Jan-2013
[455]
Thks, that's more like it...
GrahamC
10-Jan-2013
[456]
I asked this a few years ago but where would be a good place to collect 
charsets for reuse in parse rules.  They are defined in protocols 
and duplicated which seems a shame.
Chris
11-Jan-2013
[457]
Certainly there are some common ones -- alpha, numeric, hex, url, 
etc -- that'd at least be as useful to have as predefined colours...
Maxim
11-Jan-2013
[458x2]
why not just build a list and store them as a continuously growing 
setup on rebol.org?
In my dev, I have a central file for all of these.
BrianH
11-Jan-2013
[460]
Why not just make it a module that anyone can import?
Chris
11-Jan-2013
[461]
What makes predefined bitsets different from predefined colours? 
Wouldn't the case use for 'digit and 'alpha be more common than 'red, 
'green and 'blue? Or should colours move to a separate module too?
BrianH
11-Jan-2013
[462]
Predefined colors don't take a lot of memory because they're immediate 
values. Bitsets are much larger, so you don't necessarily want them 
hanging around if you don't need them. As for why they should be 
in a module, all community-provided code should go in modules. Maybe 
the colors should go in a module too.
Gregg
11-Jan-2013
[463]
http://www.rebol.org/view-script.r?script=common-parse-values.r


I think having some predefined would be great. No doubt we all have 
our own, and just having standard names for them would help.
GrahamC
11-Jan-2013
[464x3]
So, where to put them?
Module?
I'm forever defining digit, digits, alpha etc
Gregg
11-Jan-2013
[467]
Me too, Graham.


Why would we *not* want to put them in %base-constants.r, or a new 
%base-charsets.r? Colors are in %mezz-colors.r, and I would certainly 
vote to remove a number of those. Pretty sure I've never used 'papaya. 
:-)
GrahamC
11-Jan-2013
[468]
I use about 4 colours
Maxim
11-Jan-2013
[469]
IIRC those are from a standard color library.
Gregg
11-Jan-2013
[470]
That would make sense then Max, though it would be interesting to 
see how many of them are ever used.
GrahamC
11-Jan-2013
[471]
Were they chosen for html use?
Henrik
12-Jan-2013
[472]
Is this the best way to perform this check in http://www.rebol.com/r3/demo.r:

errout case [

 not value? 'size-text ["This R3 release does not provide a graphics 
 system."] ; this one
	load-gui <> 0.2.1 ["Wrong GUI version for this test script."]
	true [none]
]
GrahamC
12-Jan-2013
[473x5]
http://www.curecode.org/rebol3/ticket.rsp?id=1918&cursor=1

a htt error doesn't appear to reset the port or something.

A second read after the error doesn't actually do anything but uses 
a cached copy of the error's headers etc
A further read corrects the error in the port
parse-url in R2 gives us a target, but sys/*parse-url/decode-url 
doesn't
How about adding that in eg.


 decode-url: func ["Decode a URL according to rules of sys/*parse-url." 
 url] [
		--- "This function is bound in the context of sys/*parse-url."
		out: make block! 8
		parse/all url rules
		emit target last split-path url
		out
	]
in https://github.com/rebol/r3/blob/master/src/mezz/sys-ports.r
GrahamC
13-Jan-2013
[478x2]
http://www.rebol.net/wiki/Ports:_Synchronous_and_Asynchronous_Operations

Is this example supposed to work still?

 port: make port! http://www.rebol.com
   port/awake: func [event] [
       switch event/type [
           connect ready [
               write event/port [get %/]
           ]
           done [
               result: copy event/port
               return true
           ]
       ]
       false
   ]
   open port
   wait port
Return true in the 'done block does not exit the event loop
Robert
13-Jan-2013
[480]
Since I didn't get any response, next try: What do you think about 
re-activating Rebol/Service?
TomBon
13-Jan-2013
[481x2]
if there is no license issue why not use zmq or another mature transport/protocol 
layer?. R/S was not bad but to instable for real apps. 

Of course this will raise the old question what should be mezz, what 
native etc. but adding some 100kb to the source for well proven
components shouldn't hurt too much.
with an additional lightweight scheme for user/authentication on 
the rebol site and the zmq workhorse lives on the C side, with all 
it's advantages (speed/thread).
Robert
13-Jan-2013
[483]
For me the value was not the transport layer but the integration 
and the structure of the messaing, service look up etc.


IMO we shouldn't use a HTTP only transport layer for R/S and this 
layer shouldn't be done on the mezz level.
Pekr
13-Jan-2013
[484]
Robert - do you mean IOS? I still think, that it was kind of superior, 
although it lacked cross-reblet API. Can you see all those Google 
drives, SkyDrives? Cross device, cross user file syncing could be 
done agas ago with IOS (/Services), if RT would have some product 
manager. Pity for lost oportunity. I still think, that something 
like IOS kernel/layer could or even should be used for OpenME ...
Andreas
13-Jan-2013
[485]
Pekr: http://www.rebol.com/docs/services/
Pekr
13-Jan-2013
[486]
ah, those services. I wrote some doc about what do I don't like about 
them (naming conventions, other design issues (from my pov)), and 
Carl told me, that he is going to completly overhaul them once GUI 
is finished. That never happened though ....