Erick Tryzelaar wrote: > Jonathan Kelly wrote: >> Hi, >> >> I have a list of pointer types, and need to see if the current >> pointer I'm working on is in the list, so I need a comparison >> function to send to mem, but I can't seem to compare pointers: is it >> possible? If it isn't, how do I handle this? >> > > > This should work: > > fun eq[T]: ptr[T] * ptr[*] -> bool = "$1==$2" > Just for posterity ... what Eric suggested worked like this
fun eq[T]: ptr[T] * ptr[T] -> bool = "$1==$2"; fun eql[T] (x:&T) (y:&T):bool => eq(x, y); where (eql &obj) was passed to the List::mem function. A simplification turned out to be fun eq[T]: T * T -> bool = "$1==$2"; fun eql[T] (x:T) (y:T):bool => eq(x, y); Cheers, Jonathan. > > But I'm not sure if John wants this exposed, as it probably ends up > placing restrictions on garbage collection. John would know more. What > are you trying to do? > > -e > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Felix-language mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/felix-language
