Lisp HUG Maillist Archive

Allocating and storing a foreign string

Unable to parse email body. Email id is 133

Re: Allocating and storing a foreign string

Unable to parse email body. Email id is 134

Re: Allocating and storing a foreign string

Unable to parse email body. Email id is 228

Re: Allocating and storing a foreign string

----- Original Message -----
From: <davef@xanalys.com>
To: <cph@chi-square-works.com>
Cc: <kevin@rosenberg.net> <lisp-hug@xanalys.com>
Sent: Wednesday, March 20, 2002 3:31 PM


|       I am somewhat stuck on one feature: providing a universal lisp
string
|       to foreign string conversion that also supports passing a NULL
pointer
|       in place of a string when NIL is used instead of a lisp string.
|
| We found a problem with the solution below -
| FLI:CONVERT-TO-FOREIGN-STRING allocates.
|
| It turns out that the correct approach, rather than defining C-STRING
| as below, is to use
|
| (:REFERENCE-PASS :EF-MB-STRING :ALLOW-NULL T)
|
| to allow NIL to be mapped to the NULL pointer.
|
| :ALLOW-NULL is documented under :REFERENCE and its derived types, but
| we'll highlight its applicability when passing strings, in future
| version of the doc.

That would be worth if the FLI:WITH-FOREIGN-STRING macro accepted
:ALLOW-NULL keyword and mapped the pointer to NULL as well.
---
Sincerely,
Dmitri Ivanov
www.aha.ru/~divanov


Re: Allocating and storing a foreign string

Unable to parse email body. Email id is 368

Updated at: 2020-12-10 09:02 UTC