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

World: r3wp

[Core] Discuss core issues

Anton
29-Apr-2008
[10340]
Oldes, modification date - can you post to Rambo.
[unknown: 5]
29-Apr-2008
[10341x2]
Is this a bug?:

>> to-block mold [<]
** Syntax Error: Invalid tag -- <
** Near: (line 1) to-block mold [<]
You might ask why would someone want to mold a block and then use 
to-block on it.  If you have added a block via the console across 
more than one line you will pick up the newline character in your 
block which you can trim/lines on if you mold the block.
BrianH
29-Apr-2008
[10343x2]
Just a syntax side effect. Try: to-block mold [ < ]
< is normally part of a tag, but there is an exception made for when 
it is surrounded by spaces.
[unknown: 5]
29-Apr-2008
[10345x3]
Yeah but that would still be a bug wouldn't it?
>>  to-block mold [ < ]
** Syntax Error: Invalid tag -- <
>> attempt [to-block mold [<]]
** Syntax Error: Invalid tag -- <
** Near: (line 1) attempt [to-block mold [<]]
BrianH
29-Apr-2008
[10348]
Unfortunately, there are some REBOL values that mold to bad syntax. 
[<] is bad syntax.
[unknown: 5]
29-Apr-2008
[10349]
Yeah.  I'm finding that out.  What about the attempt?  Shoudn't that 
have contained the error?
BrianH
29-Apr-2008
[10350]
>> attempt [to-block mold [ < ]]
== none
[unknown: 5]
29-Apr-2008
[10351x2]
what version is that?
ok I see I didn't have the spaces on the attempt one
BrianH
29-Apr-2008
[10353]
In your version, the syntax error was at load time, before the attempt 
was called.
[unknown: 5]
29-Apr-2008
[10354]
This isn't good for dynamic data.  If something is populated dynamically 
then would have to account for the spaces and check the dynamic data.
BrianH
29-Apr-2008
[10355]
>> mold [ < ]
== "[<]"
[unknown: 5]
29-Apr-2008
[10356x2]
Yeah but that isn't acceptable for me.
I would classify that as a workaround and the problem still to be 
a bug.
BrianH
29-Apr-2008
[10358]
I said it was unfortunate :(
[unknown: 5]
29-Apr-2008
[10359]
hehe
BrianH
29-Apr-2008
[10360]
It used to be the case for to-file "" too.
[unknown: 5]
29-Apr-2008
[10361]
ahhh well hopefully we can get it fixed.
BrianH
29-Apr-2008
[10362]
>> [>]
== [>]
Not a problem for <
[unknown: 5]
29-Apr-2008
[10363]
Yeah just the one needs fixed then.
BrianH
29-Apr-2008
[10364]
>> [<
[    ]
== [<
]
[unknown: 5]
29-Apr-2008
[10365]
yeah that is why I need the mold to trim the lines from something 
like that.
BrianH
29-Apr-2008
[10366x2]
>> [ < ]
== [<]
>> new-line [ < ] true
== [
    <
]
Same value, different display.
[unknown: 5]
29-Apr-2008
[10368]
>> c
== "[<]"
>> d: []
== []
>> append d to-word c
== [[<]]
>> e: first d
== [<]
BrianH
29-Apr-2008
[10369x2]
>> mold new-line [< ] true
== "[^/    <^/]"
It's a little longer, but at least it will load and have the same 
value.
btiffin
29-Apr-2008
[10371]
On this I tried    a: pick first system/words 122   (umm 122 will 
vary of course)  
b: make binary! 0     save/all b a   c: to block!  b
BrianH
29-Apr-2008
[10372]
>> new-line load mold new-line [< ] true false
== [<
]
>> mold new-line load mold new-line [< ] true false
== "[<^/]"
[unknown: 5]
29-Apr-2008
[10373x2]
I'm staying away from load
just for my purposes anyway
BrianH
29-Apr-2008
[10375]
As long as you control the save, load is all right
[unknown: 5]
29-Apr-2008
[10376x2]
I think appending might be my solution for my purposes.
I can't have the newline in the block.
BrianH
29-Apr-2008
[10378]
Right, you read/lines.
[unknown: 5]
29-Apr-2008
[10379]
Thanks guys, I think I got a solution.
BrianH
29-Apr-2008
[10380]
Cool.
btiffin
29-Apr-2008
[10381]
Cool;  A little background for Brian's sake.  I bumped into this 
trying to move my LOCATE routine to TRETBASE so I was using system/words 
as a source for testing.  Didn't make it past entry 122  <   to lit-word! 
 didn't make it past 111  '/   kakks too.
BrianH
29-Apr-2008
[10382]
If you think that's bad, look at this:
>> [<]>]
== [<]>]
[unknown: 5]
29-Apr-2008
[10383]
hehe I'm dizzy
BrianH
29-Apr-2008
[10384]
>> length? [<][>]
== 1
btiffin
29-Apr-2008
[10385]
Nice tags.   :)   Leave it to Mr Hawley to get the crux
[unknown: 5]
29-Apr-2008
[10386]
Sees it as a tag
BrianH
29-Apr-2008
[10387]
Nasty, eh? :)
[unknown: 5]
29-Apr-2008
[10388x2]
yes ;-)
I think I'm on to something in REBOL and I want some input on this. 
 If I define a block in a function such as:


my-func: func [data /local blk][blk: copy []  append blk data print 
blk clear blk]


Now even though blk is cleared will the memory still be allocated 
to the size the blk expanded to accomodate the data argument?


If so, instead of clearing blk would it be better to unset or set 
blk as none at the completion of the function?  I'm just guess that 
REBOL's garbage collector wouldn't want to clear the memory allocation 
of blk since it doesn't seem efficient to do so.