Search found 43 matches
- Sun Jun 29, 2014 11:52 pm
- Forum: Anything else we might add?
- Topic: Serial Port Module?
- Replies: 6
- Views: 8688
Re: Serial Port Module?
Indeed. There is no way to avoid at least some platform specific code. There should be less of that for the UNIX family, but Windows is another story. I've finished writing an API for retrieving the baud rates that the platform supports and the list of serial port devices currently known to the syst...
- Fri Jun 27, 2014 6:59 pm
- Forum: newLISP in the real world
- Topic: newlisp -x and embedding data files
- Replies: 9
- Views: 5856
Re: newlisp -x and embedding data files
If all else fails you can embed the files into the source code as symbols via [text][/text] blocks. You could put these in external modules. newLISP may embed all the modules loaded via the load function, but I am not heavily familiar with how this feature works. As a last resort, you could create a...
- Thu Jun 26, 2014 2:56 am
- Forum: Anything else we might add?
- Topic: Serial Port Module?
- Replies: 6
- Views: 8688
Serial Port Module?
I have noticed there are no APIs in newLISP for this fairly common piece of hardware. I have written a working prototype of this functionality that works for the newLISP Linux version. Hopefully it will also work with other UNIX platforms. I was wondering if there was anyway to get this module incor...
- Mon Jun 16, 2014 4:22 am
- Forum: Anything else we might add?
- Topic: Lutz: get-cell function patch
- Replies: 3
- Views: 5141
Re: Lutz: get-cell function patch
I can't give much of a "real world" example as the functionality doesn't exist yet. But I can give a theoretical example similar to what I had in mind. It will not be for a real C API, as it is just an illustration of the syntax I wanted to make possible. ; void *fooCreate(); ; void fooAddCallback(v...
- Sat Jun 14, 2014 4:29 pm
- Forum: Anything else we might add?
- Topic: Lutz: get-cell function patch
- Replies: 3
- Views: 5141
Lutz: get-cell function patch
I have prepared a brief patch for adding a way to construct a newLISP cell from a pointer to an existing cell. I would prefer to make it a reference to the original cell instead of it getting garbage collected when the symbol's scope ends, but I did not see any easy way to do this. Instead, I wrote ...
- Sat Jun 14, 2014 3:03 pm
- Forum: newLISP in the real world
- Topic: C function callbacks
- Replies: 2
- Views: 2624
Re: C function callbacks
This leads me to believe that the best option is to use a C intermediate layer. That way I can bypass the lack of low level access I don't have from newLISP for this single purpose.
- Thu Jun 12, 2014 7:48 am
- Forum: newLISP in the real world
- Topic: C function callbacks
- Replies: 2
- Views: 2624
C function callbacks
I have something very specific I wish to do with a C library's function callbacks. It has an object-like design, and I would like to make the user data pointer I feed to the library be able to take a pointer to a newLISP object. I used the address function on the object's list of properties, but I c...
- Fri Jun 06, 2014 11:52 pm
- Forum: newLISP in the real world
- Topic: newLISP cells question
- Replies: 1
- Views: 2186
newLISP cells question
Let me see if I understand this. newLISP cells are internally composed of: an integer to track the type a linked list pointer 1st part of integer/floating point or string length 2nd part of integer/floating point or string or symbol address So, a newLISP list is implemented as a linked list with eac...
- Fri Jun 06, 2014 6:28 pm
- Forum: newLISP in the real world
- Topic: newLISP and windows DLLs
- Replies: 2
- Views: 2458
Re: newLISP and windows DLLs
I didn't think this would be an issue as C has very limited mechanisms for automated functions compared to C++, but I found a solution. I checked the DLL's dependency list, and noted that DLLs without libgcc seemed to work just fine. I tried linking with libgcc statically and newLISP no longer has a...
- Fri Jun 06, 2014 10:01 am
- Forum: newLISP in the real world
- Topic: newLISP and windows DLLs
- Replies: 2
- Views: 2458
newLISP and windows DLLs
I have tried to get newLISP to load a libnewt.dll, but the interpreter has issues upon exit. It seems to happen when the DLL is unloaded. The entire DLL was compiled by GCC 4.8.1 from the mingw32 build system. Any ideas? The error is like so: This application has requested the Runtime to terminate i...
- Wed Jun 04, 2014 1:04 am
- Forum: So, what can you actually DO with newLISP?
- Topic: NEWT C interface module
- Replies: 3
- Views: 10056
Re: NEWT C interface module
Indeed. I'm working on an object layer for the widgets using the FOOP system. I'm also seeing if I can get NEWT to work on Windows at all. The library it uses for console control has a windows port, but I'm not sure if NEWT will work on a non-POSIX platform.
- Sat May 31, 2014 7:21 am
- Forum: So, what can you actually DO with newLISP?
- Topic: NEWT C interface module
- Replies: 3
- Views: 10056
NEWT C interface module
It has taken me several days, but I have carefully converted NEWT's C API so you can access most of it from newLISP. The main thing I could not find a way to map is C variadic functions. But those are mainly used for convenience functions in NEWT. For those who do not know what NEWT is, it is an old...
- Sat May 24, 2014 9:17 pm
- Forum: Anything else we might add?
- Topic: additional C api functions
- Replies: 1
- Views: 3117
additional C api functions
I find there is a lack of C API functions for dereferencing non-aggregate pointer types. There already exist enough of them to write workarounds for the missing functionality, but I think these should be builtin so we don't have to resort to such hacks to get a basic feature. What I think would good...
- Sat May 24, 2014 8:57 pm
- Forum: newLISP in the real world
- Topic: Don't know how to pass a pointer of structure to C function
- Replies: 4
- Views: 3189
Re: Don't know how to pass a pointer of structure to C funct
Basically you need to dereference the pointer and apply pointer arithmetic. It's doable from newLISP, but this requires behavior which is tied to the size of pointers for the platform the interpreter is running on. For the platforms I know of, you need to know this: 32 bit X86 is 4 bytes and require...
- Sat May 24, 2014 3:37 am
- Forum: newLISP in the real world
- Topic: C library interfaces
- Replies: 1
- Views: 2078
C library interfaces
I have noticed that there already exists functions to import C functions at runtime. Does there currently exist a program which can automate most of the conversion of a C header to the appropriate syntax in newLISP? I have already done some searching, but I have yet to find anything conclusive. I ma...
- Thu May 22, 2014 8:42 pm
- Forum: Anything else we might add?
- Topic: The module search path on Winidows XP
- Replies: 2
- Views: 3605
Re: The module search path on Winidows XP
According to the documentation, there appears to be only a single directory from which modules are loaded by default. The environment variable "NEWLISPDIR" is used for this purpose. It appears to me that, if you want to load it from "many directories", you will need to implement it yourself. There a...
- Wed May 21, 2014 5:37 pm
- Forum: newLISP in the real world
- Topic: a journey in seek of a new language
- Replies: 2
- Views: 2905
a journey in seek of a new language
I've used C and Shell Script for about 5 years. I'm by no means a master of every detail of these languages. I have tried python, but found it to be just plain boring. Nothing challenging or interesting about it for me. I've read about Lisp in the past. It's always been portrayed as some kind of sup...
- Wed May 21, 2014 4:53 pm
- Forum: newLISP in the real world
- Topic: Don't know how to pass a pointer of structure to C function
- Replies: 4
- Views: 3189
Re: Don't know how to pass a pointer of structure to C funct
Although I am new to newlisp, I have experience with C. I believe the problem you are having is that the function you are trying to call expects a "pointer" to the struct. The struct must be allocated somewhere in memory first, and then you need to feed the address of the instance of that struct to ...