NAN revisited, a crossover from old to new.

Started by CaveGuy, October 13, 2002, 08:11:34 AM

Previous topic - Next topic

Lutz

#15
Found docs at borland.com. Problem is fixed, see announcement in News section and new files at:



http://nuevatec.com/download/development/">http://nuevatec.com/download/development/



Lutz

CaveGuy

#16
Thanks !!! I updated online test and it passed with flying colors :) ATABoy ......
Bob the Caveguy aka Lord High Fixer.

CaveGuy

#17
One more little problem with NaN :(



> (set 'X nil)

nil

> (NaN? 'X)



Value expected in function NaN?



>



I would have expected a return of nil, I will add it to the

previous online test.
Bob the Caveguy aka Lord High Fixer.

Lutz

#18
Their shouldn't be a quote before the X, you would check the symbol not the contents. But also without the qote it will give the error message because NaN? at this moment is only taking float type arguments, but this is easy to change, look for 6.5.28 in a short moment.



Lutz

Lutz

#19
turns out that, NaN? in other languages i.e. Java, C only takes floats, which kind of makes sense, because NaN is rather a subtype of float, than a type by itself. It's like you have a function 'biggerTen?' which checks numbers for beeing bigger than 10. You also would expect this function to error when given arguments, which are not numbers.



So I feel reluctant to change this.



Lutz

CaveGuy

#20
Promoting +NAN to the state of being a noun in NewLISP

was truely a big leep in logic :)



Fixing the verb NaN? to be consistent with the other XXX?

functions completes the puzzle.



NaN? should return True or False based exclusively on NaNness and nothing else.



All the other (xxxx? tests operate this way.      



The fact that NaNness is the numeric anti-nil. IT no longer

wishes to be confused with it and it's evil twin the all logical nil.



The fact that the birth of a new AI is in your hands,

should not affect your decision in any way :)



And if you are asking. WHY ME ?

You started it with NaN? I have wanted a numeric nil for years.



I appreciate the numerous leeps of logic involved in evolution of newLISP as a language. LISP, Scheme, and TK.



I know nothing about TK, which will make codeing the user interface, a real adventure. and the start of a new  thread and a new example or three :)



Thanks again, it has been fun ...

Bob
Bob the Caveguy aka Lord High Fixer.

Lutz

#21
How about a new +NaN? function pronounced: "improved NaN?"



(define (+NaN? x) (if (float? x) (NaN? x) nil))  ;;-)



but seriously, I wonder what everybody else thinks about this topic?



Anybody out there with an opinion about NaN? !?!



About TK, I am not an expert here, just supplied a workable interface to use a very popular and platformindependent way to do GUI's.



What is missing here would be a layer in newLISP providing a more LISPier way of doing GUI stuff. Personally I am more into Web GUIs and haven't thought of providing it myself.





Lutz

eddier

#22
While we are at it what about infinity (both the + and the -). Although I admit, in Complex Analysis +inf and -inf are the same thing.



The rules for using inf are in every college calculus book.



About GUIs.



I had to write a database front-end for NSLDS (financial aid stuff). I gave up on newlisp-tk, java, and wxPython and just used the newlisp httpd server and wrote a cgi in newlisp to enter data. The cgi verifys data entry and exports it to fixed record format for the Government and took half of the work required to do a full blown GUI.



Eddie

Lutz

#23
'Inf' is still part of the game on Linux and Cygwin and is returned from the GCC libraries and passed to newLISP. But on the next released version division by zero will cause a newLISP Math error in all versions and will not return Inf anymore. But in other cases Inf is still returned.



I think the NaN situation is pretty much hashed out with CaveGuy's help, but on Inf I just rely on the smartness of the underlying 'C' libraries until further notice.



That application you are describing pretty much sums up what I think about todays GUI app. writing: 99% of GUIs can be written for a Web Browser. When hosting locally just use the newLISP httpd as a very slim webserver.



I think GUIs fabricated outside of Browsers only have a very special niche today, like mouse intense graphics stuff and certain realtime stuff. The nice thing about doing Browser/CGI GUIs is, that



(1) at the same time you make an application which can be distributed/run over the Internet.



(2) parts of your application can be replaced, redesigned, because of open standards, i.e. throw in a different webserver, or interface with other web/CGI system, which may/or  not be written in newLISP.



(3) If well designed, big parts of the system can be maintained without or very little newLISP knowledge.



I think the time will come where we will see new intents to bring real-time stuff and interactive graphics to the browser. Java was pretty good at that but didn't caught on, other solutions out there are propietary.



Lutz