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

World: r4wp

[!REBOL3] General discussion about REBOL 3

BrianH
31-Jan-2013
[958]
And it's an emergency too, we really need that analysis.
GrahamC
31-Jan-2013
[959]
Rebol2
BrianH
31-Jan-2013
[960]
It might be easier. It's parsing, and uses MAP-EACH a lot, and there's 
a bug in MAP-EACH in R2 (that's my fault, sorry), but that is one 
approach I'll have to consider.
Andreas
31-Jan-2013
[961]
Win32, I assume?
BrianH
31-Jan-2013
[962]
Yup.
Andreas
31-Jan-2013
[963x4]
1207 is RP_MISSING_END
Only point that is thrown is within the GC.
Is it easy for you to reproduce?
I mean, can you quickly run a test binary and see if things improve?
BrianH
31-Jan-2013
[967]
I can reproduce it like clockwork. It even crashes in the same spot 
every time. Send me your test binaries!
BrianH
1-Feb-2013
[968x3]
I'm going to save this version of the crashing script, then see if 
I can get it to crash with local files only, then see if I can get 
it to crash without using the files at all (since they are proprietary). 
Also, I have to make a separate version that doesn't crash so I can 
get the results. This is annoying, but if we can get a GC bug fixed 
in R3 then it will be worth it.
Apparently I can make it last longer by using the *EACH functions 
less., switching to loops that don't allocate contexts. However, 
I create objects to store the data, so those eventually cause the 
crash. Still repeatable, so it's probably happening after allocating 
a certain number of objects/contexts. It acts identically on 32bit 
and 64bit Win7, crashing at the same point in the process.
Switching the objects allocated in the data to maps makes the crash 
go away altogether. That narrows down what to search for rather thoroughly.
GrahamC
3-Feb-2013
[971x2]
How does one compile r3 for a platform in which there is no existing 
R2 ?
Just curious as to how r3 would make it to Aros
Scot
3-Feb-2013
[973]
Compile a simple c version of make make for Aros?
Arnold
3-Feb-2013
[974]
Carl states that he can do it in 5 minutes. (Because he has the sources 
for R2) :(
BrianH
3-Feb-2013
[975]
Graham, I thought that make make uses R3, not R2. You could run make 
make on another platform, then copy the resulting setup files to 
your target platform.
GrahamC
4-Feb-2013
[976]
that sounds right ... if I can install Aros I might give it a whirl
BrianH
5-Feb-2013
[977]
Going over some basic evaluation errors, which look like they're 
easier to fix than I thought they'd be. While at it, I've been discovering 
R3 language features that I never knew about before. Going to check 
older versions to see when they were added. Turns out that there's 
a SET optimization that I never knew, but which would really come 
in handy :)

>> a: 1 
== 1 
>> set [:b] [a] 
== [a] 
>> b 
== 1


Setting a get-word in a block to a word sets the get-word to the 
value of the word, not to the word itself. This would eliminate the 
intermediary block in most set word-block reduce value-block expressions, 
making it a better multi-assignment function.
Rebolek
6-Feb-2013
[978]
Is there an opposite function to DEHEX in R3?
Ladislav
6-Feb-2013
[979]
Setting a get-word in a block to a word sets the get-word to the 
value of the word, not to the word itself.

 - this is rather dangerous if not documented, I do not think it is 
 expectable
VincentE
6-Feb-2013
[980]
Rebolek: to-url
Rebolek
6-Feb-2013
[981]
Vincent, unfortunately not:


>> to url! "http://www.domain.com?url='http://nope.it.is/unencoded'"
== http://www.domain.com?url='http://nope.it.is/unencoded'

Anyway, I wrote simple enhex function that does what I need.
BrianH
6-Feb-2013
[982x3]
Ladislav, document it then. It's too useful to drop. And according 
to the docs you couldn't use get-words in SET block at all, so I 
never wrote code that had them. SET block with anything other than 
word! is rare, at least until R3 added FUNCT, which makes set-words 
very common.
It is a little unfortunate that SET [:word] works like get-word parameters 
used to in R2, but don't anymore. Inconsistent. Still, too useful 
to drop.
Works that way in R2 as well, so if it would have caused a problem, 
it hasn't so far :)
Scot
6-Feb-2013
[985]
Care with documentation on this one.  Could become a problem if people 
know about it.
BrianH
6-Feb-2013
[986x4]
Not really. It would only be a problem if people started using this 
and someone wanted to remove the feature.

It hasn't been a problem so far, and there's nothing wrong with the 
code. This code:
    set [:get-word] [word]
is currently equivalent to this code in R2:
    get-word: get 'word
There's a general problem in R3 that SET block acts like SET/any 
block, but I'm going to fix that too.
AFAICT noone has used get-words in a SET block call before, even 
in R2 code.
It would be interesting for this feature to make it into Red as well, 
just to cut down on intermediate block creation. Of course an optimizing 
compiler could get rid of the intermediate block creation too, changing 
SET block into a multi-assignment statement.
Ladislav
6-Feb-2013
[990x2]
s currently equivalent to

 - I think I already wanted to have something like that a couple of 
 times. It probably will be useful, the question being where to put 
 this doc
Do you find the Rebol programming wikibook appropriate?
BrianH
6-Feb-2013
[992x2]
Sure, why not? I don't really follow it.
We should add tests for this behavior too, just so we can be notified 
if it gets removed.
Scot
7-Feb-2013
[994]
Was somewhat tongue in cheek comment.  So many things that are really 
powerful that are under-documented.
BrianH
7-Feb-2013
[995]
Agreed, and speaking of which I also noticed RETURN/redo, which even 
has a visible option and I didn't notice it before. It's a general-purpose 
function trampoline, and as hard as I try I haven't run out of new 
ideas for how to use it.
Scot
7-Feb-2013
[996x2]
Phenomenal!  :)
The ultimate Mulligan!
Maxim
7-Feb-2013
[998]
I'm having some trouble understanding what's the point of return/redo. 
 isn't it a way to implement pretty nasty side-effects?  

so far I can see quite a few ways to fuck up a program using it, 
but nothing useful that can't be done some other way...


brian, can you give me some good example of what new things it allows?
GrahamC
7-Feb-2013
[999]
Knowledge capture here  http://stackoverflow.com/questions/14760916/why-does-return-redo-evaluate-result-functions-in-the-calling-context-but-block
BrianH
7-Feb-2013
[1000x4]
Well, beyond what I wrote on SO, I think it might allow you to implement 
the kinds of functions that needed the [throw] function attribute 
in R2 that we don't have in R3. I haven't worked through the details 
yet though, so don't make any assumptions about that yet.
Basically, it allows you to do exactly what DO function allows, since 
it basically *is* DO function.
And, it does break through the APPLY security trick, which I might 
want to review some code about. I think that needs a ticket.
>> apply does [return/redo :add] [1 1] 1 1
== 2
Sorry, this is a better illustration:
>> apply does [return/redo :add] [] 1 1
== 2


If you were using APPLY to protect your code from get-word hacks, 
you're SOL. There's no point in removing the /redo option because 
the same trick could be done with native functions. We just need 
to fix APPLY so it does its /redo to the arguments it takes.
BrianH
8-Feb-2013
[1004x3]
Warning, check your code, http://issue.cc/r3/1763is coming! Make 
sure that SET block! block! uses SET/any when that is what you mean.
Also SET object! block!, since it has the same bug.
If you have any code that uses SET block! block! or SET object! block!, 
and the values block might possibly have unset values in it, then 
*your code is buggy*. If you want the unset values to be assigned, 
you should be using SET/any. If you want the unset values to trigger 
errors (a fair assumption, since you're using SET instead of SET/any), 
those errors are currently *not* being triggered because of a bug 
in R3. Either way, check your code.
GrahamC
8-Feb-2013
[1007]
Buggy until this is fixed?