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

World: r3wp

[Core] Discuss core issues

Rebolek
11-Aug-2006
[5142]
hehe :)
Sunanda
11-Aug-2006
[5143]
the pwerpack idea was a good one: one central point for crucial mezzanines 
and their documentation, perhaps as easily included as 
  do %powerpack.r 
  powerpack/install 'all
in user.r
Pekr
11-Aug-2006
[5144x2]
c:\> cd rebol
c:\>rebol\
c:\>rebol\dir
rebol.exe
powerpack.r
c:\>rebol\rebol.exe %powerpack.r
c:\>rebol\dir
rebol.exe
powerpack.r
rebol3.0.exe
it works :-)
Henrik
14-Aug-2006
[5146]
is there a complete list of all the error codes anywhere? I think 
the error appendix in the Core manual is not adequately describing 
them.
Pekr
14-Aug-2006
[5147]
not sure, never saw something like that ...
Henrik
14-Aug-2006
[5148]
it would make it a lot easier to create error handling, if you are 
running some code and might expect a large number of different errors 
that need to be translated into a different language
Anton
14-Aug-2006
[5149]
Have you probed system/error ?
Henrik
14-Aug-2006
[5150]
yes, but I think it's hardly a useful way to do this. once again 
you have to dig around in the system object to figure something out.
Anton
14-Aug-2006
[5151]
You might be able to put the translated strings directly into the 
error objects before the errors are thrown.
Henrik
14-Aug-2006
[5152x2]
I could if I didn't need to process the error contents. For example, 
I try to connect to an FTP server using an URL with user/pass in 
it. This is normally hidden from view, but if the URL fails, the 
entire user:[pass-:-url] is passed to the error object in clear text.
but I see your point
Anton
14-Aug-2006
[5154]
I see, so you would like to show error messages to the user, but 
not reveal the clear text authentication details.
Henrik
14-Aug-2006
[5155x2]
that's one thing. another thing is to make it meaningful to the users. 
it's part of explaining what caused, say a TCP error 550 and help 
the user to act on it, rather than just saying "TCP error 550 blabla". 
The same error may be meaning different things in different contexts.
user interface contexts, that is
Anton
14-Aug-2006
[5157]
- It looks like you can derive the complete list of error codes from 
system/error,  eg: from
	print mold system/error/math
  you can see that  square-root  -1   gives error code 402

- what kind of descriptions do you see as lacking from the Core manual 
section on error codes ?
- I think whole books have been written on errors.
Henrik
14-Aug-2006
[5158]
sorry, I was misreading something and the things I wanted are actually 
in the manual
Anton
14-Aug-2006
[5159]
that's alright. :)
Pekr
16-Aug-2006
[5160x3]
how to substract two date values easily? I simply have file date 
(get in info? filename 'date), and I want now - such filedate to 
return time difference including days .....
oh my, now when I wrote the word "difference" I want to try something 
... :-)
hmm, it might work actually :-) I was simply wondering, why substracting 
now - get in info? filename 'date is rounded to zero ....
Gabriele
16-Aug-2006
[5163]
subtract gives difference in days (integer), while difference gives 
difference as a time! so it is finer grained.
Pekr
16-Aug-2006
[5164x2]
but why? I did not specify now/date - get in info? filename 'date 
.... imo that is incorrect
simple 'now simply returns complete date and time, so why rounding 
to days?
Anton
16-Aug-2006
[5166]
An old decision - probably not going to change. (although Rebol3 
could change this.) I agree it seems anti-intuitive. If it's not 
in rambo already, make a ticket.
Henrik
19-Aug-2006
[5167]
would anybody be interested in some PHP tools? a source generator 
with REBOL blocks -> PHP arrays, variable lists. a simple thing.
Ladislav
22-Aug-2006
[5168x2]
would you say, that it is OK, that 

    for i b: [1] tail b 1 []
is an infinite loop?
Pekr
22-Aug-2006
[5170]
what is that? :-) tail b evaluates to what exactly? :-)
Ladislav
22-Aug-2006
[5171]
if you try the code in the console, you will find out, that it is 
an infinite loop. The question is, if it is OK, (I would not expect 
that normally, because FOR can be implemented in such a way that 
the loop is finite)
Pekr
22-Aug-2006
[5172x2]
yes, but what b: evaluates to? it is block ... I though that the 
syntax is - for word value-from value-to skip []
b is referring to block containing one element, tail to some position 
... I would understand if there was index? involved, but ....
Ladislav
22-Aug-2006
[5174]
FOR should be able to work for series too according to its spec
Pekr
22-Aug-2006
[5175]
and btw - what if you would refer to past tail - in current version 
it is error, in R3 it is supposed to return none ....
Ladislav
22-Aug-2006
[5176]
so the value-from is the block b: [1]
Pekr
22-Aug-2006
[5177]
interesting, that series working for 'for I mean - is that anyhow 
usefull? :-)
Ladislav
22-Aug-2006
[5178]
it is the spec, so one "cure" may of course be to disallow series
Pekr
22-Aug-2006
[5179]
I will let it to gurus to decide, but it does not sound logical to 
me, as it states - starting value, ending value ... what is starting 
value for [1 2 3 4]? What is for ["c" "a" "b"], what is for [b c 
d] (referring to others, e.g. binary?) .... we imo refer to index 
here, don't we?
Ladislav
22-Aug-2006
[5180x2]
starting value is [1 2 3 4], next value is [2 3 4], etc.
so my understanding is, that according to you it is not OK and you 
would suggest to disallow series as starting and ending value
Pekr
22-Aug-2006
[5182]
yes, but my suggestion says nothing - it is natural to think in that 
way, because of how I am used to 'for from another languages - otoh 
- Rebol is dynamic and allows many things, which other languages 
don't, so I just don't know. But if you would not mention it is possible, 
I would probably never used it that way ....
Ladislav
22-Aug-2006
[5183]
don't argue with yourself leave something for others ;-)
Pekr
22-Aug-2006
[5184x2]
arguing with ourselves sometimes helps to answer some questions ourselves 
:-)
... or to confuse ourselves even more :-)
JaimeVargas
22-Aug-2006
[5186x4]
;; This example illustrates a bit better the behaviour of FOR with 
series

>> series: [a b c d e f g h i j k]  

== [a b c d e f g h i j k]

>> start: skip series 0

== [a b c d e f g h i j k]

>> stop: skip series 6

== [g h i j k]

>> for b start stop 1 [print mold b]

[a b c d e f g h i j k]

[b c d e f g h i j k]

[c d e f g h i j k]

[d e f g h i j k]

[e f g h i j k]

[f g h i j k]

[g h i j k]
>> for b start stop 2 [print mold b]

[a b c d e f g h i j k]

[c d e f g h i j k
]
[e f g h i j k]

[g h i j k]
>> for b start stop 6 [print mold b]

[a b c d e f g h i j k]

[g h i j k]

>> for b start stop 7 [print mold b]

[a b c d e f g h i j k]
Just a small typo, replace b with series for the examples of FOR 
usage.
From the behavior it looks like FOR looks very similar to FORSKIP. 
Only that breaking when the series index is greater than stop.
;So a similar result can behaviour can be  accomplished  with FORSKIP, 
ie:


>> forskip series 2 [print mold series if 6 < index? series [break]]

[a b c d e f g h i j k]

[c d e f g h i j k]

[e f g h i j k]

[g h i j k]

is equivalent to

>> for b start stop 2 [print mold b]

[a b c d e f g h i j k]

[c d e f g h i j k]

[e f g h i j k]

[g h i j k]


I believe we should have only one form for acommplishing the this 
type of series traversal. FORSKIP seems like the better choice than 
FOR. I support  removing series support from FOR. If series support 
is maintained with FOR the infinite loop race condition should be 
removed.
Ladislav
25-Aug-2006
[5190x2]
did you know, that

    repeat i 2'148'483'647 []

is an infinite cycle in REBOL?
sorry, I meant:

    repeat 2'147'483'647 []