World: r3wp
[!REBOL3]
older newer | first last |
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. |
Pekr 31-Dec-2010 [6799x2] | I hope Carl re-appears refreshed, and defines the beta-list. I wish for device extensions, user types, tasking, timers, new codec system, network schemes :-) |
Some of things might be done by the community, but some of those things are doable only by Carl ... | |
GiuseppeC 31-Dec-2010 [6801] | Pekr, too many things together. See you at the beginning of 2013 :-) |
Kaj 31-Dec-2010 [6802] | Carl will probably reappear frustrated, because he's working on R2 now ;-) |
Gregg 31-Dec-2010 [6803] | Ladislav, I meant that I'm fine with the current model, but if someone presents a strong argument for it I won't discount it out of hand. |
Kaj 3-Jan-2011 [6804] | What does WAIT NONE do? |
Anton 4-Jan-2011 [6805x5] | It waits for events. |
Ports implicitly waited for by WAIT NONE can be seen in the wait-list: print mold system/ports/wait-list | |
Check ?? do-events WAIT [ ] === WAIT NONE | |
13-Sep-2006 Anton Rolls WAIT without also waiting for events: view layout [ button "wait 2" [ remove find system/ports/wait-list system/view/event-port wait 2 ; wait two seconds insert system/ports/wait-list system/view/event-port ] ] | |
Oops, this is Rebol3 group. Sorry, I'm in Rebol2 head-space. | |
Kaj 4-Jan-2011 [6810x2] | Thanks |
I was hoping it would do more or less what you programmed: servicing system events but without waiting for all windows to close | |
Pavel 5-Jan-2011 [6812] | How works the preallocation in R3? str: make string! 10000 length? str -> 0 dtto for blocks etc? why it happens in r3 program? prepared for future use? |
Ladislav 5-Jan-2011 [6813] | Preallocation allocates the space needed to store the required number of characters into string. Nevertheless, the length of the string is zero, since the string initially does not contain any characters. |
Henrik 5-Jan-2011 [6814] | it's there primarily to help the garbage collector. |
Pavel 5-Jan-2011 [6815x4] | So the space IS already reserved? |
So the space IS already reserved? | |
So the space IS already reserved? | |
sorry Altme hangs for me | |
Ladislav 5-Jan-2011 [6819x2] | Here is an example showing a difference: >> time-block [str: make string! 0 loop 10000 [append str "a"]] 0,05 == 0.0023125 >> time-block [str: make string! 0 loop 10000 [append str "a"]] 0,05 == 0.0024375 |
>> time-block [str: make string! 10000 loop 10000 [append str "a"]] 0,05 == 0.002265625 >> time-block [str: make string! 10000 loop 10000 [append str "a"]] 0,05 == 0.002265625 | |
Henrik 5-Jan-2011 [6821x2] | yes, when doing a make string! 10000, the space is preallocated. this helps the garbage collector to collect quicker and also speeds up operations on the string when its expanding in size. |
its expanding in size, within the preallocated size, that is. | |
Ladislav 5-Jan-2011 [6823x2] | I would not say that it "helps the garbage collector to collect quicker", but it does not require to reallocate/recollect the space when expanding the string to 10000 characters length |
and, of course, when no reallocation occurs, no content movement is necessary | |
Pavel 5-Jan-2011 [6825] | Does it also means that it allocates consecutive space? |
Ladislav 5-Jan-2011 [6826] | REBOL strings as well as REBOL blocks (parens, paths, the majority of series,...) use consecutive space |
Robert 8-Jan-2011 [6827] | Is it already supported to get the output of a CLI programm executed via CALL? |
Pekr 8-Jan-2011 [6828x2] | no |
there were several discussions about the topic. Carl stated, that R2 code was very complex, and is willing to provide source for adaptation. After some complaint, we got /wait at least. I think that for now you have to use call/wait, output to file, and read the file .... | |
Pavel 10-Jan-2011 [6830] | Is there any reason why proxy is not implemented? Should it be part of http scheme or should be intermediate scheme? ie http -> proxy -> tcp. Where is oplaned to save proxy settings in R3? |
BrianH 10-Jan-2011 [6831] | The HTTP scheme in R3 needs a lot of work (hopefully not a full rewrite). That's why. |
older newer | first last |