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

Ladislav
11-Jan-2007
[2421x3]
hi, did anybody notice, that sometimes

    a-value: make port! http://

works, while sometimes is end up as follows:

** User Error: No network server for HTTP is specified
** Near: a-value: make port! http://
it ends up
 - sorry for spelling
the first result can be obtained e.g. by starting a fresh REBOL console 
first and then type in the expression

the second one can be obtained in Windows by defining a Do action 
for .r files as follows:

    C:\Rebol\sdk-2-6-2\tools\rebview.exe "%1"


and then right-clicking on a file containing just a REBOL header 
and the above mentioned expression and picking the Do command
Anton
12-Jan-2007
[2424x2]
So does the second way always produce the error ?
I don't seem to have the option to create a Do command in WinXP SP1
Gabriele
12-Jan-2007
[2426x2]
ladislav, could it be that the second way skips user.r and thus does 
not set a default network server?
ie. can you verify a set-net is being executed before that?
Ladislav
12-Jan-2007
[2428x4]
checking
indeed, Gabriele, if I make sure set-net is executed, the problem 
does not occur
Anton - I am using WinXP SP2, but I am positive that it is possible 
in SP1 too
you can define the action in Windows explorer, check registered file 
types
Gabriele
12-Jan-2007
[2432]
ok, so it's not really a bug; it's just that when you have a default 
network server, rebol uses that for any protocol. (set net does not 
actually set the smtp server; it sets the default server. since the 
send function does not specify any server, the default server is 
used to send email; that's why the default server is normally set 
to the smtp server)
Ladislav
12-Jan-2007
[2433x2]
thanks
what do you think about this:

    0:0:0.1 = 0:0.1 ; == true

doesn't it look strange?
Izkata
12-Jan-2007
[2435]
Very, considering 0:0 defaults to hours:minutes -
>> 0:0
== 0:00
>> 0:0.1
== 0:00:00.1
Gabriele
12-Jan-2007
[2436]
hmm... you can have decimal only for seconds... so i guess rebol 
tries to make sense of 0:0.1 by assuming you meant 0:0:0.1
Izkata
13-Jan-2007
[2437]
Maybe it should convert 0:0.1 into 0:0:6 ?  IIRC, Ti calculators 
do that when working with degrees/minutes/seconds...
Gabriele
13-Jan-2007
[2438x3]
0:0 is ambiguous. rebol normally takes that as hours:minutes because 
it's the most common case ("it's 10:07 am now"). but when you write 
1:0.7, rebol can see that you probably meant minutes:seconds, so 
it interprets it that way.
if the format was something like 10h12m3s, then you could write 0h0.1m 
and it could be taken as 0:0:6.
anyway, i guess Carl will change it to whatever is the most useful 
for people, so if most people think that 0:0.1 should mean 0:0:6 
he will probably change it.
Maxim
15-Jan-2007
[2441]
I'm not sure I'd change the time... the above, as explained by Gabriele 
is what is happening, and its very logical... the dot is consistent. 
and fixes the inconsistency of  0:10:0 and  0:10 being the same thing.
Ladislav
15-Jan-2007
[2442x2]
this is a copy of a fresh REBOL interpreter console. Do you think 
it is covered by the documentation, or should I put it to RAMBO?
>> a: make string! 15
== ""
>> insert a "a"
== ""
>> a
== "a"
>> str: make struct! [s [string!]] reduce [a]
>> str/s
== "a"
>> insert/dup tail a "b" 14
== ""
>> a
== "abbbbbbbbbbbbbb"
>> str/s
== "a"
>> recycle
>> str/s
== "¸^D^G^A"
Maxim
15-Jan-2007
[2444]
if we wanted to support decimal minutes and hours, I'd suggest that 
time then support using decimal values in all parts of a time like 
so:

0:.1:00
0.2:00
0:0.25:0.124


then we'd be forced to write 0:0:0.124 and the inconsistency would 
disapear.  a part from the above discrepancy in that you don't have 
to supply seconds
Ladislav
15-Jan-2007
[2445]
Regarding the decimal point in time value issue - my POV is, that 
if users find it natural, then there is no need to change the behaviour
Maxim
15-Jan-2007
[2446x4]
I find the current time is adequate in all scripts I've done so far... 
it just has to be documented... if it currently isn't
I also find that all types should be described within a convertion 
matrix.
row/column of values with equivalent outputs in all other types.
Ladislav, why is the str/a corrupted after a recycle?
Ladislav
15-Jan-2007
[2450x2]
my interpretation: a is relocated to be able to grow and STR does 
not "protect" the old memory while still referencing it
I guess I should put it to RAMBO, because it is not covered by the 
STRUCT! documentation
Maxim
15-Jan-2007
[2452]
ybut the size is within the 15 bytes you asked at a's outset no?
Ladislav
15-Jan-2007
[2453x2]
yes, that is another issue - due to an INSERT quirk you need to allocate 
17 places to make sure 15 elements fit in
(already in RAMBO)
Maxim
15-Jan-2007
[2455x2]
and in any case, the reduced "a" is separate (copied) and in ram 
is probably equivalent to a: make string! 1...  so I guess the real 
bug is that structures do not properly identify regions of ram they 
point to.
<shudders> in my spine... if this is the case !
Ladislav
15-Jan-2007
[2457x2]
reduced "a" is not copied...
you can make sure by inserting less elements (say 2)
Maxim
15-Jan-2007
[2459x2]
I have written 4 replies to the above, and everytime, I remember 
another detail about struct which is not obvious... and in all cases, 
I come back to this being a GC bug IMHO.
(replies I never sent... since they didn't identify another possibility 
when the sentence was finished)
Ladislav
15-Jan-2007
[2461]
aha :-)
Maxim
15-Jan-2007
[2462x2]
(and you are right, the reduced "a" is not copied. if you change 
the first letter, then str/a is also changed)
I looked quickly at the code... and tought I'd seen rejoin somewhere 
;-)
Gabriele
15-Jan-2007
[2464]
i think it should be considered a bug, the old string should probably 
not be GCed or there should be some way to tell struct! what to do. 
(wasn't there a "save" attribute for structs?)
Joe
15-Jan-2007
[2465x2]
resize-image: func [
	dest [file!]
	size [pair!]
	file [file!]
	/local im
][	
	im:		load-image file
	save/png 	dest to-image layout [origin 0x0 image (im) (size)]
	im:		none
]
this leaks on 1.3.2.4.2  Is it a bug ?
Maxim
15-Jan-2007
[2467x2]
the GC does not imediately recycle memory.
does this grow to hundreds of MB of RAM if you do this in a loop?
Ladislav
15-Jan-2007
[2469]
right, Gabriele, the save attribute is mentioned in http://www.rebol.com/docs/library.html#Garbage
, but it doesn't look like related to this situation
Gabriele
15-Jan-2007
[2470]
we may need a new attribute... i wonder what happens if you set the 
pointer manually though. either way you might get bugs. (though, 
your example is more common than setting the pointer manually, so 
i'd prefer to have that fixed.) we can also just state, that this 
is a documentation problem, and that the programmer should take care 
of keeping the string valid (it's for C interfacing after all, although 
we use structs for other things too)