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

World: r3wp

[!REBOL3]

Steeve
21-Dec-2010
[6749x2]
but yeah
R3 is more lenient
Kaj
21-Dec-2010
[6751]
Hasn't the first form always been like that?
Steeve
21-Dec-2010
[6752x3]
Don't think so, but my memory is not that good :-)
Don't think so, but my memory is not that good :-)
I Remember something like: 
Hey ! You past the end !
Izkata
21-Dec-2010
[6755x2]
At one point in R2, it was something like this:
>> X: [1 2]
== [1 2]
>> X/2
== 2
>> X/3
== none
>> X/4
!Error
(...well, for some reason I remember it that way, at least.  There's 
a chance I have it confused with something else...)
BrianH
21-Dec-2010
[6757x2]
Steeve, you are right, I missed that :(
Gregg, my answer to your question is that writing micro-optimal code 
in the first place is usually not premature optimization; it is instead 
just avoiding having to rewrite as much of the code later. So it's 
still optimization, just not premature. Making macro-optimizations 
before you have the overall design done is usually premature optimization, 
but if your code style is consistent then you can make them later 
without having to rewrite too much, in my experience :)
Ladislav
21-Dec-2010
[6759]
Re "premature optimization" - I do not think I ever did have any 
feeling I used that. For example, I would never want to write O(n 
*n) code when O(n) is available, no matter how would anybody want 
to call my approach.
RobertS
21-Dec-2010
[6760]
I posted a note on Geany as a possible linux rebol tool in IDE as 
Carl's Rebol Blog is no place for running notes - but altme cannot 
tag a topic ?  And trying to select a group here on linux as ALTme 
1.2.25 is loading is just a crap shoot - highlight and click and 
close yore eyes or is it the reverse?
Henrik
21-Dec-2010
[6761]
Probably because AltME resorts the groups as you are trying to click 
the one you want, thus getting the wrong one.
Gregg
21-Dec-2010
[6762]
We might want to change groups on the opimization topic. How about 
Performance?
Jerry
27-Dec-2010
[6763]
Do we have NaN (Not A Number) defined in R3?
Henrik
27-Dec-2010
[6764]
I don't think so. Is it needed?
PeterWood
27-Dec-2010
[6765]
This page suggests that the "internals" of R3 does have NaN defined 
http://www.rebol.net/wiki/Decimals-64but it doesn't appear to be 
accessible.
Sunanda
27-Dec-2010
[6766]
Related topic, Jerry: INFs (see comment from Carl, which perhaps 
offers some hope that the situation will be normalised one day):
    http://www.curecode.org/rebol3/ticket.rsp?id=1717
Ladislav
27-Dec-2010
[6767x3]
This page suggests that the 

internals" of R3 does have NaN defined" - how does the text suggest 
it? I, as a coauthor will try to correct the text, if it does.
Certainly, IEEE754 defines NaN, but Rebol does not need to use/define 
it in any way.
So, for Rebol decimals, NaN is not defined/supported at present, 
nor are there any plans to use it in the future.
Jerry
27-Dec-2010
[6770]
Thanks for the answer, Ladislave.
Ladislav
27-Dec-2010
[6771]
(but, of course, if such a wish exists, there is always the possibility 
to put it as a wish to CureCode)
Henrik
27-Dec-2010
[6772]
yes, put it in curecode. if it's rejected, at least there would be 
documentation of why it's rejected.
Ladislav
27-Dec-2010
[6773]
Do we know a reason why it is desirable to have decimal! NaNs?
PeterWood
27-Dec-2010
[6774]
Ladislav - The following sentence implies that there is an internal 
NaN:
 

The exponent value 2047 is reserved for overflow and NaN (Not a Number)
Geomol
28-Dec-2010
[6775x2]
I wrote that, I think. I got it from a IEEE 754 definition, like
http://en.wikipedia.org/wiki/IEEE_754-1985

Think of that part of the text as a description of the floating point 
standard used by CPUs.
Maybe you can try
to-decimal #{ ... 16 digits ... }

If that still works, you can use it to test, what you get, when you 
construct numbers like NaNs. To see how REBOL3 handle it.
Ladislav
28-Dec-2010
[6777x5]
Just checked. That sentence is in the section named "IEEE754 standard", 
so it is OK.
The IEEE754 standard reserves such a value for NaNs, overflow, etc. 
But, that does not mean, Rebol has to implement those.
BTW, "reserved for X" does not mean "X is implemented", it just means, 
that it should not be used for other purposes.
Nevertheless, I would like to see some coherent reasons why to support 
NaNs in Rebol.
As far as I am concerned, I guess, that Carl felt that:

>> 1 + (square-root -1) / 2
** Math error: positive number required
** Where: square-root
** Near: square-root -1

is more comfortable, than

>> 1 + (square-root -1) / 2
== #[NaN]

could be
Sunanda
28-Dec-2010
[6782]
The primary reason for supporting NaNs would be for easy of interaction 
with systems that do support NaN, eg Oracle.


Right now, any REBOL system that was trying to trade values with 
an Oracle system that supported NaN and +/-INF would need to code 
for special cases.


However, I do not know of anyone who has such a need -- so time for 
some to make the busines case!
Ladislav
28-Dec-2010
[6783]
Business case for NaNs???? Zero probability.
Sunanda
28-Dec-2010
[6784]
It depends on the business :)
Ladislav
28-Dec-2010
[6785]
I am sure, that my estimate is accurate
Henrik
28-Dec-2010
[6786]
perhaps it's better to look at why other languages implement NaN.
Ladislav
28-Dec-2010
[6787]
Any particular language you do want to imitate?
Henrik
28-Dec-2010
[6788]
If it's part of a standard, then I guess not. I'm guessing that languages 
like javascript implement it to make error handling of bad numbers 
easier in ways that may not be necessary for REBOL.
Robert
28-Dec-2010
[6789]
IIRC, the NaN stuff is mostly necessary in assembler and on the hardware 
level to trigger an exception and somehow report back a problem. 
If any layer now handles this exception it's not necessary to further 
bubble it upwards to interpreters, user scripts etc.
Cyphre
28-Dec-2010
[6790]
IMO In JS the NaN stuff is just annoying 'feature' which makes debugging 
harder.  Would you like to deal with the NaN or better just get an 
immediate error?
Geomol
28-Dec-2010
[6791x3]
Many languages are implemented using C. If you don't do anything 
particular regarding NaNs, you get outputs like from this C program:

#include <math.h>
#include <stdio.h>

int main()
{
	printf ("%lf\n", sqrt (1.0));
	printf ("%lf\n", sqrt (-1.0));
	printf ("%lf\n", sqrt (2.0));
}

Output:

1.000000
nan
1.414214


So it may actually take more effort to grab the NaN output and make 
e.g. an error output. Like REBOL does:

>> square-root -1
** Math Error: Positive number required
** Near: square-root -1
(By REBOL example is by using R2. Not sure how R3 does this.)
*My*
Gregg
29-Dec-2010
[6794]
I've never felt a need for NaN, but I also haven't done symbolic 
stuff or things where I think it would help to have it as a missing 
value. I'm open to it if there's a valid case though.
RobertS
30-Dec-2010
[6795]
Pharo Smalltalk implements two methods as    isNaN    but has no 
such class  and  I no longer see NotANumber in Cincom Visual Works 
Smalltalk so that covers a new Smalltalk implementation ( Pharo )and 
a very mature implementation ( VW ).  Two recent languages to check: 
might be Falcon and Io ( falcon is not yet 1.0 at falconpl.org )
Ladislav
31-Dec-2010
[6796]
Re: "I am open to it" - maybe I misunderstood: do you mean, that 
you really want to obtain NaNs from expressions instead of errors 
being triggered?
Claude
31-Dec-2010
[6797]
guys, 2010 is almost finished, and R3 is still not there ;-( ....................but 
happy new year  anyway .................
GiuseppeC
31-Dec-2010
[6798]
Hope 2011 will bring us GUI; SQLite, REBDB and other databases connection; 
many tickets closed. I don't ask for more.