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

World: r3wp

[RAMBO] The REBOL bug and enhancement database

Anton
7-Feb-2006
[1547x4]
>> save %afile [1]
>> print read %afile
[1]
>> load %afile
== [1]
>> load/all %afile
== [[1]
]
>> save %afile [1 2]
>> print read %afile
1 2
>> load %afile
== [1 2
]
>> load/all %afile
== [1 2
]
LOAD and LOAD/ALL are the same when there are multiple values in 
the block, but different when there is only one value.
(I think I will post a ticket for this...)
Gabriele
8-Feb-2006
[1551]
LOAD and LOAD/ALL are the same when there are multiple values in 
the block, but different when there is only one value.


Exactly, and I think that is intentional, although weird and probably 
deserving some discussion.
Anton
8-Feb-2006
[1552x2]
Deserving discussion, yes. Do you have any idea what this difference 
of LOAD/ALL could be used for ? Anyone ?
I suppose that's why I should post a ticket.  :)
Henrik
8-Feb-2006
[1554]
I first thought that mold and mold/all would be the mirrored functions 
of load and load/all, but that's not the case?
Anton
8-Feb-2006
[1555x2]
Umm...
I would say SAVE should mirror WRITE MOLD, and LOAD should be orthogonal 
to that.

(Or at least, that's what you kind of expect.) (and same for SAVE/ALL, 
MOLD/ALL, LOAD/ALL.)
Henrik
8-Feb-2006
[1557]
hmm...
Ashley
8-Feb-2006
[1558]
load/all is very useful if you are loading a block of values from 
a file, eg.

	1 2 3 "Bob"


and you don't want to code for the case where the file only has one 
value in it. For example, with a file containing a single value in 
it I get:

>> load %a.txt
== 1
>> load/all %a.txt
== [1]


but in all other cases (zero or more than one value), I always get 
a block. I asked about this ages ago and the answer at the time was 
that beginners expected to be able to "load" a value without worrying 
about unwanted block creation (and those who wanted it would use 
load/all).
Anton
8-Feb-2006
[1559]
Yes, it all seemed to make sense at the time SAVE/ALL and LOAD/ALL 
were implemented. I remember the discussions about it. But trying 
to get a consistent method for saving/loading my data the other night 
proved very confusing. I spent a couple of hours testing different 
cases and I still haven't finished thinking about the issue.
Henrik
8-Feb-2006
[1560]
I would probably have said that if you are to return something, use 
as few different types as possible, even at the cost of an additional 
function. then a block would be returned regardless of contents
Anton
8-Feb-2006
[1561]
Yes, that's what I had in mind. One way of saving and loading, where 
I can always expect the data in a particular format.
Ashley
8-Feb-2006
[1562]
In RebDB I ended up with the following to handle this:

	switch/default length? tables/:table/data [
		0	[write tables/:table/dat-file ""]
		1	[save/all tables/:table/dat-file first tables/:table/data]
	][
		save/all tables/:table/dat-file tables/:table/data
	]
Anton
8-Feb-2006
[1563x3]
I think, as per Gabriele's suggestion, that can be simplified to:
	write  tables/:table/dat-file  mold/all tables/:table/data
(though it's not exactly the same for the 0 case.)
(The only reason I would want to use SAVE or SAVE/ALL is to avoid 
the slightly longer expression: WRITE MOLD or WRITE MOLD/ALL)
If I have to make a custom function to get consistent behaviour then 
I might as well just use WRITE. :-)
Gabriele
8-Feb-2006
[1566x2]
note: save/all and load/all are unrelated, and they were added at 
different times.
also, if you are using load/all, you will need mold/only/all on the 
example above. the /all in mold is unrelated to the /all in load 
and means that all values are serialized.
Carl
8-Feb-2006
[1568]
Yes, I agree that the difference in behavior makes it more painful.
Graham
8-Feb-2006
[1569]
From the Orca channel .. it would be good to set up a way of "voting" 
or other way of determining of what are the priorities for *developers* 
that RT should focus on.
[unknown: 9]
8-Feb-2006
[1570]
Agreed.
Anton
9-Feb-2006
[1571x2]
Ah that's very interesting !  I had the strong impression load/all 
and save/all were supposed to be orthogonal, even though I had read 
the function help for each one.
Maybe it is my failing ? Am I so stubborn to continue to try to make 
something work the way I imagined it, instead of considering that 
  maybe it just won't work that way, and to look around for the (what 
should have been) obvious alternatives ?
Ammon
13-Feb-2006
[1573x2]
REBOL/Command 2.5.125.3.1
Copyright 1997-2005 REBOL Technologies

>> write clipboard:// "test"
** Access Error: Invalid port spec: clipboard://
** Near: write clipboard:// "test"
>> read clipboard://
** Access Error: Invalid port spec: clipboard://
** Near: read clipboard://
(That's running on Windows XP Media Center...)
BrianH
14-Feb-2006
[1575]
clipboard:// just works with View. Did you try /Command/View ?
François
20-Feb-2006
[1576]
Hi, i just posted a new bug on rambo: When calling 'request-file 
and clicking on Cancel, the value returned is %none instead of none 
--> makes more complicated to test the returned value. I tested under 
Windows XP
Graham
20-Feb-2006
[1577]
>> type? request-file
== none!
François
20-Feb-2006
[1578x4]
Well, you are right, from the console, it is ok, but try from a script... 
I have %none and file! as as result
My mistake!!! Sorry!
It works, indeed...
Just send a feedback to RT to ask them to disregard the rambo ticket
Gabriele
20-Feb-2006
[1582]
deleted
Volker
7-Mar-2006
[1583x5]
Interesting memory-bug
filet!: context [filet: none]
spec: [filet: 1]
fil: make filet! spec
recycle probe stats
repeat i 10000[
 fil: make make filet! spec fil
]
recycle probe stats
repeat i 10000[
 fil: make make filet! spec third fil
]
recycle probe stats
make object! object! does not release.
make object third object! does.
(thats like make object! block!
linux 1.3.2
Is this repeatable, and clear enough for rambo?
JaimeVargas
7-Mar-2006
[1588]
Do you want me to test in OSX?
Volker
7-Mar-2006
[1589]
Good idea.
JaimeVargas
7-Mar-2006
[1590]
I don't understand the error. Do you want the output I am getting?
Volker
7-Mar-2006
[1591x4]
Yes.
Its three memory-stats (after recycle).
all should be same, or similar low.
the second is a lot higher, because the objects from the first loop 
are not relased.
JaimeVargas
7-Mar-2006
[1595x2]
Well after the make I get errors.
The data is:
run1: 1716394
run2: 3396726
run3: 1717126