Re: apply:include, currying, free var...then a surprise!
Jan Wielemaker <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 07/25/2013 07:24 AM, Ian Tegebo wrote: > ?- apply:include(file_name_extension(_,'.pl'),['a.pl','b.txt','c.pl'],PrologFiles). > PrologFiles = ['a.pl']. I think this should explain it: 1 ?- include(file_name_extension(F,'.pl'),['a.pl','b.txt','c.pl'],PrologFiles). F = a, PrologFiles = ['a.pl']. Cheers --- Jan p.s. do not use apply:. It will cause include to call its argument in the apply module. The Quintus module system is designed for importing namespaces, not for making explicit calls. Calling M:G calls G `as if it was called from M'. > > ?- [user]. > isplf(F) :- file_name_extension(_,'.pl',F). > |: % user://1 compiled 0.07 sec, 2 clauses > true. > > ?- apply:include(user:isplf,['a.pl','b.txt','c.pl'],PrologFiles). > PrologFiles = ['a.pl', 'c.pl']. > > Is this an addressable bug, a problem that exists between keyboard and > chair, or a known problem I should learn to live with? > > As an aside, please ignore my not using prolog_file_type/2. >