r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3]

BrianH
2-May-2010
[2537x2]
safe-make: make :make [[
    "Constructs a specified datatype."
    type [datatype! any-object!] "The datatype or example value"
    spec [any-type!] "The attributes of the new value"
]]
And add more datatypes to the spec as testing determines them to 
be safe.
Steeve
2-May-2010
[2539x2]
Wait.... I need to disgest that insanity at first... make :make...
I'm tired.... You could give me some time...
BrianH
2-May-2010
[2541x2]
Compare spec-of :make to see the difference.
If might help the insanity to know that you can't do this yet. After 
copying the above message to the clipboard:
>> do clipboard://
Script: "Untitled" Version: none Date: none
** Script error: invalid argument: [[
        "Constructs a specified datatype."

        type [datatype! any-object!] "The datatype or example value"
        spec [any-type!] "The attributes of the new value"
    ]]
** Where: make catch either either applier do
** Near: make :make [[
        "Constructs a specified datatype."
   ...
Gabriele
3-May-2010
[2543]
I'm willing to bet that that is internal rebol initialization code 
that we won't be able to use.
Ladislav
3-May-2010
[2544]
According to the blog it looks like a newly available feature, not 
working with older interpreter versions...
Pekr
3-May-2010
[2545]
If I understand new proposed syntax correctly with my very limited 
REBOL brain :-), we will be probably able to "reassign" functions 
(not only), providing shortened argument block, hence dissallowing 
rest of arguments, and binding such new function to the body of the 
original one, so creating some kind of wrapper around the original 
one?
Ladislav
3-May-2010
[2546x2]
If you remember, once I used a trick to achive the same effect to 
enhance the BIND function
(in R2)
BrianH
3-May-2010
[2548]
Pekr, that's almost it, but not quite:

- All functions are a wrapper around a spec and a body, though the 
body of natives is internal.

- You will be able to make a new function derived from an old one, 
with a new spec, body or both, or just the same.

- When the spec isn't changed in the derived function, it will likely 
get a copy of the old spec, not the original.

- When you make a new REBOL function without changing the body, the 
new function will have a deep copy of the body, not the original.

- When you make a new native function (action!, native!, command!, 
maybe op!) it will call the same code, not a copy.


We'll have to see what changes we can safely make to specs without 
breaking functions. Right now we know we can change doc strings and 
typespecs, but we'll have to see if we can change argument ordering, 
naming and number. I expect that more changes will be possible with 
REBOL functions than there are with natives, due to the new function 
getting and rebinding its own copy of the code block. And natives 
might need some more internal type screening in order for this to 
not be a problem.
Maxim
3-May-2010
[2549]
still pretty nifty.  except for javascript I are there other languages 
which can do this?
BrianH
3-May-2010
[2550x2]
You can't do this in Javascript.
Javascript function derivation is like object derivation.
Maxim
3-May-2010
[2552x4]
is es5 you can derive functions and manipulate them...
which is semanticely the same... IMHO
functions are first order types in JS  afaik.
although the syntax in R3 is pretty, in JS is very ugly  :-)
BrianH
3-May-2010
[2556]
Ah, I must look into this. I knew they were first-order types from 
the beginning, but not that the code and specs had themselves become 
data.
Maxim
3-May-2010
[2557]
es5 adds a lot of new tricks for playing around with values.  the 
args list can be retrived, applied, changed, etc.  I'll admit the 
part about the code body is a bit fuzzy in my mind, but I seem to 
remember that you could play around with it in some way too.
 

playing around with the functions isn't exactly the same but the 
end results are very similar IMHO. 

especially since hot-patching isn't allowed in R3 anymore.
BrianH
3-May-2010
[2558]
switched to the right channel
Maxim
3-May-2010
[2559x2]
one thing that ES5 does which I still long for in REBOL is how they 
have opened up the accessors, for everything as well as management 
of object keys, and member attributes like writeable, replaceable, 
public, etc.
oops, yeah sorry.
Pekr
3-May-2010
[2561x2]
When you make a new REBOL function without changing the body, the 
new function will have a deep copy of the body, not the original.
 - why the copy?
BrianH: maybe it was not practically usefull, but removing hot-patching 
capability from REBOL - haven't we lost some level of reflectivity?
BrianH
3-May-2010
[2563x2]
Because it has to be rebound, and because inline series data is modifiable.
haven't we lost some level of reflectivity?
 - Yes. The unsafe parts have been removed.
Steeve
3-May-2010
[2565]
I would prefer an optionnal mechanism
BrianH
3-May-2010
[2566x2]
R3 is being built to be able to run untrusted code. Still a goal 
rather than a reality yet, but it's a *design* goal.
And you have an optional mechanism: You can derive a new function 
and replace the references to the original. If those references aren't 
protected.
Pekr
3-May-2010
[2568]
not sure if hot patching was any usefull. I used it just to show 
my friends, that I can modify my func from inside its code block. 
But you can dynamically eventually build copy of function, etc., 
so not sure not having a hot-patching is a problem ...
BrianH
3-May-2010
[2569]
If the references *are* protected, then that means that the code 
using those references expects the code to be the same, to run the 
same, or else. The ability to hot-patch that code destroys that trust.
Henrik
3-May-2010
[2570]
hot patched code can be difficult to read :-)
BrianH
3-May-2010
[2571x2]
Ugh, agreed Henrik :(
Pekr: "when is A98 going to be released?"

I don't know. I thought soon, but then Carl went wild with fixes 
and core semantic changes like the 'self stuff. It may still be soon, 
since those are done. It depends on how many more magic tricks Carl 
wants to pack into this release.
shadwolf
4-May-2010
[2573]
rebol 3 are you around ?
shandwolf pokes rebol 3 .. hum ? still breathing ?

OH COMON I WANT R3 FULL RELEASE BEFORE XMAS 2010 !!

in advance thank you
BrianH
4-May-2010
[2574]
Funny :)  We missed your input in the huge flurry of R3 development 
last week though.
GiuseppeC
4-May-2010
[2575]
There is an ongoing discussion about REBOL3 objects and accessors 
ongoing into the "Other Languages" section. BrianH and Maxim have 
discussed and a proposal has been made at http://www.rebol.net/wiki/Objects_enhancements.

This proposal is only of their side and we request the other GURUs 
to partecipate to build up other POV.
Then the proposals will be submitted to Carl.

Please partecipate ! The object  heart is open right now and in the 
hands of Carl ! :-)
Ladislav
4-May-2010
[2576]
I see it as a matter of priorities, and declare, that it is not my 
priority.
GiuseppeC
4-May-2010
[2577]
Ladislav,  we see Carl focusing on some or some other part of REBOL. 
This time he is working on the object part of the language. It would 
be good to have your (and the other) respected opinion about this 
topic now. Maybe we will be able to close this topic which has been 
opened in the blog in the distant year of 2006.
However, no one is forcing anyone to do anything...
Pekr
4-May-2010
[2578]
what's 'filter-error? It's undefined in R3 .... http://www.rebol.com/r3/docs/errors/internal-bad-path.html
BrianH
4-May-2010
[2579]
I expect that it is just some adhoc function that Carl rigged up 
in order to be able to generate the examples on the error pages.
Ladislav
4-May-2010
[2580x2]
Yes, Giuseppe, understood, what I wanted to say (to not sound rude) 
is, that I prefer to not "distract" Carl with this, seeing other, 
more "urgent" problems in CureCode...
I would especially like to see is the problem of Throw, Break, etc. 
solved, and the problem of function Return (comprising other issues) 
solved.
BrianH
4-May-2010
[2582]
Don't worry Ladislav, the Parse project took a few months to sort 
out before there was a need to involve Carl. It should take some 
time to just search through the blog and comments for ideas (minus 
the inappropriate ones of course).
Ladislav
4-May-2010
[2583]
And, maybe surprisingly, I really do not feel an urgent need to solve 
this, being pretty content with the current state of affairs
BrianH
4-May-2010
[2584]
And that few months was with just two main participants, some historical 
suggestions and a few helpful souls. The object debate would affect 
more people.
Ladislav
4-May-2010
[2585]
Regarding Parse: I am quite surprised, that only two people (in esence) 
edited the enhancement proposal in a substantial way, while others 
(surely having their wishes, or opinions) did not "dare" to commit 
more changes to the document...
BrianH
4-May-2010
[2586]
I don't mind the current state of affairs either, as the current 
(post 'self debate) object model (including the PROTECT tickets) 
works great, and is more general than object models with explicit 
support for classes and properties. It would help if you could look 
over the PROTECT tickets though, Ladislav.