This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bit Bashing with Guile


This happens on a 32bit box:

guile> (logand #b1000000000000000000000000000000 0)
0
guile> (logand #b10000000000000000000000000000000 0)
ERROR: In procedure logand in expression (logand 2147483648 0):
ERROR: Wrong type argument in position 1: 2147483648
ABORT: (wrong-type-arg)

I conclude from this this that Guile is unable to handle 32+ bit numbers
with logical functions, is this correct?
Since i need this (i'm trying to implement CAST-128 encryption as per RFC2144)
i wonder wether anyone found any solution to this problem already
short of using vectors for the bit patterns?
I know i could patch the guile sources to include a CAST encryption function,
but i'd prefer a Scheme-only solution.
Any help is appreciated, and thanks in advance,
	-forcer

-- 
/* A committee is a life form with six or more legs and no brain.         */
/* email: forcer@mindless.com      -><- www: http://webserver.de/forcer/  */
/* IRC: forcer@#StarWars (IRCnet)  -><- PGP/GPG: available on my website  */