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

World: r3wp

[!REBOL3-OLD1]

Steeve
18-Oct-2009
[19072]
Missing something till now.

The sharing of same series is lost when they are serialized. They 
are duplicated instead.

There is missing some internal unique surrogate in the serialized 
format of a serie.
It's why RIF can't be realized until now, i guess...
Maxim
18-Oct-2009
[19073x3]
yep that is a limitation.  it would be easy to implement on top of 
it... because there is an explcit serialized form right in the language.
something like 
#[string! 1: "hahaha" 3]
#[string! :1 5]
they key being valid within one load session.
Steeve
18-Oct-2009
[19076x2]
yep, something like this
it would be a big num, so a binary surrogate would be a better choice 
(more compact).
#[string! "hahaha" 3 #FF00FF00]
#[string! #FF00FF00 5 #FF00FF00]
Maxim
18-Oct-2009
[19078]
we could even use this within source code, so that when it loads 
an application, shared strings are pre-linked without needing to 
do init code.
Steeve
18-Oct-2009
[19079x2]
In all cases, it will be a wast of space for all the small series.
I mean in the source
Maxim
18-Oct-2009
[19081]
but mold/ doesn't have to add surrogates if they aren't being shared. 
 The internals have reference counters to data, so it alerady knows 
if a value is shared.
Steeve
18-Oct-2009
[19082]
you're right
Maxim
18-Oct-2009
[19083]
it could even go a step further and check if the shared serie is 
used in the block of code being molded, but that would hamper speed 
a little bit... a /compact refinement could be used to switch this 
extra verification.
Steeve
18-Oct-2009
[19084]
perhaps...
Maxim
18-Oct-2009
[19085]
it sounds like an easy thing for carl to implement... it only modifies 
a very small subset of natives.
Steeve
18-Oct-2009
[19086]
don't know :-)
Paul
18-Oct-2009
[19087x4]
Would be cool if REBOL interpreter could generate some form of symbol 
file for encapped scripts.
Not the interpreter per say but the REBOL encapsulator.
Even if we can't get that it would be cool to at least to get a some 
form of symbol file for the core.
Just think of how much more bugfixes could be made if that were the 
case.
Chris
18-Oct-2009
[19091]
The serialised would be acceptable, if that were the literal form 
too, instead of - make map! []


It's too bad there's no succinct way left to represent that (and 
objects for that matter)
BrianH
18-Oct-2009
[19092]
MOLD/all generates the serialized form, and LOAD reads it. You can 
even write the serialized form literally in your scripts. For map! 
there is no problem with using the serialized form. For objects and 
functions, you'll have binding issues.
Chris
19-Oct-2009
[19093x4]
I understand that, I use that notation in some work - it's just a 
case where Rebol notation is a little less economical.
I also understand that at a point, you have to say that it's good 
enough. I use Rebol a lot and at times think, it would be great if... 
Many times I get this with apparently trivial details - but then 
perhaps I overly obsess over details.
I do wonder if as the serialized notation used an almost valid Rebol 
sequence #[] (actually, that may well have been valid at one point?) 
you could take a similar approach with regard to maps?  ![] @[]
=[] |[] - not pretty, and perhaps not as graphically immediate as 
other types, but an improvement over make map! [] perhaps?
Sunanda
19-Oct-2009
[19097]
Stackoverflow question:

     >  Is it possible to know the script/object/function that is executing 
     ?
     > If not will this be possible in R3 ?
            http://stackoverflow.com/questions/1585603


I've given an R2-ish answer.....Perhaps R3 has a better way via stack, 
debug or other guru trick
Pekr
19-Oct-2009
[19098]
hehe, found-out Carl started to address bitsets, as new doc starts 
to appear here - http://www.rebol.com/r3/docs/datatypes/bitset.html
:-)

He also restructured a bit main R3 Doc page ....
Pekr
20-Oct-2009
[19099]
2.100.91: PARSE: adds DO and ACCEPT. Adds COMPLEMENT on bitsets (first 
draft.)
Henrik
20-Oct-2009
[19100]
Pekr, could you describe find/first?
Pekr
20-Oct-2009
[19101]
Yes, although I don't know much. You can find it in Carl's own priority 
list - http://rebol.com/r3/docs/project.html, described as - "FIND 
/first with list of targets", priority high. I do remember Carl planned 
to add it because of GUI? You simply want to check on multiple targets, 
and it returns first match ...
Henrik
20-Oct-2009
[19102]
I wonder if it has something to do with templates. Can't still see 
what exactly it does.
BrianH
20-Oct-2009
[19103x2]
Same a finding a charset, except it's a set of longer values than 
single characters. Position of the first in the set found returned.
Basically the same as PARSE TO multiple (and might use the same code).
Henrik
20-Oct-2009
[19105]
oh, so this would be possible:

find/first string ["steeve" "brian"]
== "steeve came first, brian came second"
BrianH
20-Oct-2009
[19106]
Yup. And like TO multiple, the alternative is exponential time and 
tricky to program.
Henrik
20-Oct-2009
[19107]
find/first/all would be cool :-)
BrianH
20-Oct-2009
[19108]
FIND/first/all would be FIND/all.
Henrik
20-Oct-2009
[19109]
I guess it would be. Considering that, what about find/into?
BrianH
20-Oct-2009
[19110]
Use PARSE.
Henrik
20-Oct-2009
[19111x2]
or maybe it's just as fast to:

append str copy find str2 "something"
I was thinking about the /into for appending the result to a different 
series.
BrianH
20-Oct-2009
[19113]
I think that FIND/all would just return true/false, not a block full 
of positions.
Henrik
20-Oct-2009
[19114x2]
I would hate that.
If so, I understand Steeve's suggestion for using parse instead.
BrianH
20-Oct-2009
[19116]
I may misunderstand the proposal.
Henrik
20-Oct-2009
[19117]
I think he means both. He just talks about TRUE/FALSE for bitsets:


One possible justification would be if FIND/all is useful for other 
series. For example, a FIND/all on a block might return a block of 
results.
BrianH
20-Oct-2009
[19118]
FIND/all would definitely return true/false if searching bitsets.
Pekr
20-Oct-2009
[19119x2]
find/first string ["steeve" "brian"] ??? I expected more of find/first 
[str1 str2 str3] value
I thought that it would serve to do lookup on multiple different 
targets ("series" switching) ....
BrianH
20-Oct-2009
[19121]
>> find/first "foobarbaz" ["baz" "bar"]
== "barbaz"
Order doesn't matter in the values yo are searching for.