Re: Bit-manipulation in ISO Prolog
From: Nameless (news.mail_at_chello.no)
Date: 08/17/04
- Previous message: Pere Montolio: "Re: Bit-manipulation in ISO Prolog"
- In reply to: Pere Montolio: "Re: Bit-manipulation in ISO Prolog"
- Next in thread: Jens Kilian: "Re: Bit-manipulation in ISO Prolog"
- Reply: Jens Kilian: "Re: Bit-manipulation in ISO Prolog"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 17 Aug 2004 15:13:48 +0200
"Pere Montolio" wrote in message
news:d0867bad.0408170058.5e355986@posting.google.com...
> > "Nameless" <news.mail@chello.no> wrote in message
> > ...
>
> I assume you know this answer for "xor":
>
> xor(X,Y,Z) :- Z is ( (\ X) /\ Y ) \/ ( (\ Y) /\ X ).
>
> (hope no typo mistakes).
>
> and pray that you compiler/interpreter of prolog has a good
> optimizer.
Right!
> (note: in general I look always for compilers with and easy
> interface to C, in order to be able to add small low level
> functions).
Pere, I think that's rather missing the point, namely the
absence of (the very useful) 'xor' in ISO Prolog.
>From a practical point of view, since most Prologs are
actually implemented in C or a similar imperative language
that has bit-meddling functions, it would be most
surprising not to find matching Prolog predicates. Which is
all the more reason to wonder why ISO Prolog lacks 'xor'.
> I agree it is not a great answer, but it is all I have.
I came up with the same solution too, but this seemed so
clumsy I thought that there must be a better one. I guess
not. Many thanks for confirming this, Pere. I'll be
generous and thank Bart, too. ;)
> PS: Do you known any good reason to do not post with a real
> name?
Yes. ;)
-- Mail sent to this email address is automatically deleted (unread) on the server. Send replies to the newsgroup.
- Previous message: Pere Montolio: "Re: Bit-manipulation in ISO Prolog"
- In reply to: Pere Montolio: "Re: Bit-manipulation in ISO Prolog"
- Next in thread: Jens Kilian: "Re: Bit-manipulation in ISO Prolog"
- Reply: Jens Kilian: "Re: Bit-manipulation in ISO Prolog"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|