Re: Loading database from string (C API)
Jan Wielemaker <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 12/11/2013 03:41 PM, Edd Barrett wrote: > On Wed, Dec 11, 2013 at 03:24:31PM +0100, Jan Wielemaker wrote: >> On 12/11/2013 02:37 PM, Edd Barrett wrote: >>> On Wed, Dec 11, 2013 at 02:34:18PM +0100, Jan Wielemaker wrote: >>>> It is a bug in PL_term_type(). This function is not very popular and >>>> (thus) poorly maintained. Stream handles are `blobs'. Blob is SWI-Prolog's >>>> internal super-type for shared symbols. Atoms are >>>> just a sub-type thereof. Some examples: >>>> >>>> I'll fix PL_term_type() >>> >>> Ah ha! >>> >>> Can you link me to the diff after? Thanks. >> >> Pushed. See >> >> http://www.swi-prolog.org/git/pl-devel.git/commit/a93cf7b973675026fbaf5fe1cdb0008bdcb9a549 >> >> This will not be back ported to 6.6.x. I'd rely on other tests >> if you want to know more than the basic classification PL_term_type() >> gives you in the old versions. > > Thanks Jan. > > Unfortunately I am using the version 6.6.0. > > Can you point in the direction of these other tests? I don't see > anything relating to blobs here: > http://www.swi-prolog.org/pldoc/man?section=foreign-term-analysis It is one level higher: http://www.swi-prolog.org/pldoc/man?section=foreigninclude Search for blob. Basically, if PL_term_type() gives PL_ATOM, it may be a blob or a real atom. Use PL_is_atom() to find out. Cheers --- Jan >