Ticket #24 (closed defect: fixed)

Opened 4 months ago

Last modified 4 months ago

varlist : correctly implemented ?

Reported by: victor Owned by: pmoura
Priority: major Milestone: Logtalk distribution
Component: library Version: 2.32.1
Keywords: Cc:

Description

Hello,

I am wondering if varlist has not a problem for predicates defined in list and using unification :

varlist::select(A, [A, C, D], R).
R = [C, D] ;
A = C,
R = [C, D] ;
A = D,
R = [D, C] ;
false.

I expected this behavior :

varlist::select(A, [A, C, D], R).
R = [C, D] ;
false.

Maybe a solution would be to rewrite completely varlist implementing listp ...

I can do it if you think it is a good idea.

Attachments

Change History

Changed 4 months ago by victor

I forgot to say :

maybe I misunderstand varlist, but shouldn't it be named strictlist (like in "strict equality") instead of varlist ?

I personally use memberchk from it because it does not unify ...

Changed 4 months ago by victor

Or maybe keep the extension of list, but reimplementing more predicates that needs it ... since there is a lot of them that does not need a rewrite.

Changed 4 months ago by pmoura

  • owner set to pmoura
  • status changed from new to assigned

Changed 4 months ago by pmoura

  • status changed from assigned to closed
  • resolution set to fixed

Corrected for the predicate select/3 in r4402. There might be other predicates that should have local definitions instead of using the ones inherited from "list". Let me know. Not sure about the name change.

Add/Change #24 (varlist : correctly implemented ?)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.