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

World: r3wp

[!REBOL3]

Paul
6-Mar-2010
[1387x3]
The point isn't about whether or not I can do that.  I already do. 
 The point is that it offers more for the construct function to do 
at what I believe would be less cost with more to gain.
This the way you guys should think about REBOL.
Shouldn't always be about - just creating a new mezzanine.  Think 
about the cost of the mezz verses an enhancement to existing code.
Andreas
6-Mar-2010
[1390]
Paul what you are asking is that the construct function should rather 
arbitrarily rewrite the block argument it is passed.
Paul
6-Mar-2010
[1391x3]
huh? - not at all.
construct/as-is [a: b: 2]
Why would that be so difficult?
Andreas
6-Mar-2010
[1394]
Paul, set-word!s are syntax for SET. [a: b: 2] is syntactical short-hand 
for [SET 'a SET 'b 2]. SET returns sets a word to a value and returns 
that value. If you don't want to pass the result of (SET 'b 2) as 
argument to SET 'a, then just don't do it.
Paul
6-Mar-2010
[1395x3]
The block argument doesn't have to change at all - just the handling 
of it.
Yeah, Andreas, you would have thought I woulud have figured that 
out since I have been doing REBOL since 1998.  That must be something 
new.  ;-O
Now for real, it was just a request for something rather not as complex 
as the fear around it.
Andreas
6-Mar-2010
[1398]
Great, then write /as-is as a mezzanine for now and propose it to 
be included.
Henrik
6-Mar-2010
[1399]
Paul, you're basically asking for REBOL to do a fundamental change 
to its syntax inside construct.
Steeve
6-Mar-2010
[1400]
with 2 blocks it's easy, one for the definition, one for the assignement.

>> assign: funco [spec vals][append construct spec vals]
>> assign [a: b: c: d:][c: 2]
== make object! [
    a: none
    b: none
    c: 2
    d: none
]
Paul
6-Mar-2010
[1401x2]
Explain what you mean by fundamental?
Am I asking for the construct code to be change - duh!
Andreas
6-Mar-2010
[1403]
That you want a peculiar change to set-word! semantics.
Paul
6-Mar-2010
[1404x2]
Never said that Andreas.  Just in how it wants to handle the processing.
The block wouldn't be passed to set directly is all
Andreas
6-Mar-2010
[1406]
Which block?
Paul
6-Mar-2010
[1407]
The code in construct would have to parse the block
Chris
6-Mar-2010
[1408x2]
From (a: (b: (c: 2))) to ((a:) (b:) (c: 2))
That's a fundamental change...
Paul
6-Mar-2010
[1410]
so what is an unfundamental change?
Chris
6-Mar-2010
[1411]
Writing an intermediate solution for special cases...
Paul
6-Mar-2010
[1412x2]
its code that never gets executed unless the refinement is set.
no different than an either.
Andreas
6-Mar-2010
[1414]
unchain: func [spec] [forall spec [if all [set-word? first spec not 
tail? next spec set-word? second spec] [insert next spec :none]] 
spec]
Paul
6-Mar-2010
[1415]
And now I would ask you why add that function to R3 when you already 
pass a spec to contruct in the first place?
Andreas
6-Mar-2010
[1416]
I guess that's what you want. Now adding that as refinement to construct 
is a question of wether it would be of general utility. If not, it 
would just be bloat.
Paul
6-Mar-2010
[1417]
My point is that if we just adding your entire function to R3 verse 
a refinement to construct - we would be adding MORE bloat
Andreas
6-Mar-2010
[1418]
I personally think that neither that function nor the refinement 
should be added.
Paul
6-Mar-2010
[1419]
You fear change?
Andreas
6-Mar-2010
[1420]
Nope. I just don't see any general utility of it.
Paul
6-Mar-2010
[1421]
See I do.
Andreas
6-Mar-2010
[1422]
That's why it probably is best kept alongside your code, to cater 
for your special purpose needs.
Paul
6-Mar-2010
[1423]
So if I went to falcon or Lua and said do that and they did they 
could say they could handle such code safer than REBOL could.
Andreas
6-Mar-2010
[1424]
That's not an safety issue.
Paul
6-Mar-2010
[1425x3]
The hell it aint.
Maybe your confortable with it.  Oh well.  But if you don't think 
the chain evaluation should be a safety concern then I think your 
not being rational.
let's say you have a service oreient protocal that is sending unencrypted 
blocks of data that is getting sent into contstruct on the other 
end.   All I have to do is capture it midstream alter the block and 
forward on and I can cause your code to behave differently.
Henrik
6-Mar-2010
[1428]
why is that a safety concern? in that case REBOL would be one big 
security hole as this is standard syntax.
Paul
6-Mar-2010
[1429]
Are you saying it isn't true Henrik?
Andreas
6-Mar-2010
[1430]
Paul, construct is using standard REBOL syntax in this case. If that 
is a safety concern for your purposes, that's outside the scope of 
CONSTRUCT.
Chris
6-Mar-2010
[1431x2]
If you're already iterating through your block to convert every second 
word to set-word, then why not also neutralise any set-words that 
should be - seems that is where the flaw is...
..should not be...
Paul
6-Mar-2010
[1433]
But what if I'm not the one doing it.
Henrik
6-Mar-2010
[1434]
Paul, you don't create services that carelessly evaluate data that 
is potentially manipulated by an attacker. That's a security hole 
and bad coding. That's one of the good things about dialects.
Chris
6-Mar-2010
[1435]
Agreed, and that's what this is - a dialect - as Rebol's sop is chaining...
Paul
6-Mar-2010
[1436]
I'm not saying to stop chaining am I?