Documentation example error for import...

Started by oofoe, September 17, 2016, 07:28:10 AM

Previous topic - Next topic

oofoe

Hi!



Hope this is the best place to post this...



The first example for import at http://www.newlisp.org/downloads/newlisp_manual.html#import">http://www.newlisp.org/downloads/newlis ... tml#import">http://www.newlisp.org/downloads/newlisp_manual.html#import is incorrect. It should have the following marked line added:

(define LIBC (lookup ostype '(
("Windows" "msvcrt.dll")
("OSX" "libc.dylib")

(import LIBC "printf") ;; This line needs to be added to make example work.

(printf "%g %s %d %cn" 1.23 "hello" 999 65)

Thanks!
Testing can show the presence of bugs, but not their absence.

Lutz

#1
Thanks Oofoe, corrected here:



http://www.newlisp.org/downloads/newlisp_manual.html#import">http://www.newlisp.org/downloads/newlis ... tml#import">http://www.newlisp.org/downloads/newlisp_manual.html#import

and here:

http://www.newlisp.org/downloads/development/inprogress/">http://www.newlisp.org/downloads/develo ... nprogress/">http://www.newlisp.org/downloads/development/inprogress/

oofoe

#2
Hi!



Thanks very much for fixing that. It's a small thing, but it can really trip someone up when they're trying to make something like that work for the first time.



Any possibility of getting the "(import LIBRARY)" syntax in Windows too? With maybe some way to list the symbols in the library?



Thanks!
Testing can show the presence of bugs, but not their absence.

IVShilov

#3
Quote from: "oofoe"
Any possibility of getting the "(import LIBRARY)" syntax in Windows too? With maybe some way to list the symbols in the library?

Use DependencyWalker.

I see all exported functions, but still cannot understand why newlisp crashes with first call of function imported from libiconv.dll.