<dan2>
SLi: but thats reverse order, not adjacent bytes
<dan2>
so in other words, get it into an array/list of the size of a byte and reverse?
<SLi>
Ah, well, it becomes essentially reverse order. It's from the most significant to the least significant byte or vice versa.
<SLi>
But if you have 2 int16s, first 0x1234 and then 0x5678, it is different from an int32 0x12345678. The former becomes 34 12 78 56, the latter 78 56 34 12.
<dan2>
I see
<SLi>
So you need to know the data type size to make the conversion, but within that type just reverse the bytes.
<mauke>
but only if host and network byte order differ
<SLi>
Yes.
<dan2>
right
<dan2>
but x86 differs from network byte order
<SLi>
Yes.
<SLi>
Funny that the std libraries don't have hton* and ntoh*.
<mrvn>
And there is alls moddle endian.
<mrvn>
#define __LITTLE_ENDIAN 1234
<mrvn>
#define __BIG_ENDIAN 4321
<mrvn>
#define __PDP_ENDIAN 3412
<mrvn>
But hopefully PDP users are dying out.
<SLi>
Of course there every digit represents one byte and not one nybble...
<mrvn>
SLi: yeah, funny think.
<mrvn>
thing.
<SLi>
Perhaps it's really best to use the c functions if you want to be portable.
<SLi>
(Funny, usually it's best to avoid c if you want to be portable.)
<mrvn>
I don't see anything in ocaml to handle the endian conversion otherwise.
<mrvn>
In C the conversion functions get optimized out completly if the conversion is a NOP. If I do the s.[0]*256+s.[1] thing it will always take time.
Smerdyakov has joined #ocaml
m3ga has joined #ocaml
mrsolo_ has quit [Read error: 145 (Connection timed out)]
ulfdoz_ has joined #ocaml
m3ga has quit [Read error: 60 (Operation timed out)]
ulfdoz has quit [Read error: 60 (Operation timed out)]
m3ga has joined #ocaml
Smerdyakov has quit ["sleep"]
m3ga has quit ["Client exiting"]
cjohnson has quit [Remote closed the connection]
vezenchio has quit ["Ayn Rand encapsulates the rage that every teenager feels on finding that his first paycheque has had taxes taken out of it"]
Herrchen has joined #ocaml
__DL__ has joined #ocaml
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
ionOS has joined #ocaml
smimou has joined #ocaml
Gueben has joined #ocaml
Gueben has quit [Remote closed the connection]
_JusSx_ has joined #ocaml
smimou has quit ["?"]
Gueben has joined #ocaml
Snark has joined #ocaml
<Snark>
slt
ionOS has quit ["Leaving"]
smimou has joined #ocaml
<Gueben>
salut
mrvn_ has joined #ocaml
mrvn has quit [Read error: 60 (Operation timed out)]
dm has joined #ocaml
raboof has joined #ocaml
<raboof>
what would be a suitable data structure for a `mapping' between 2 types, when i want to be able to search for the value given a key but also for the key given a value?
<mrvn_>
just search?
<mrvn_>
2 hash tables?
<raboof>
yeah, my current solution is 2 hashtables that i keep in sync manually
<raboof>
just that didn't seem too elegant :)
<mrvn_>
you could write a module for a doubly hashed table. But since objects are just one pointer you don't gain much by it.
clog has joined #ocaml
Smerdyakov has joined #ocaml
Smerdyakov has quit []
Skal has joined #ocaml
Skal has quit [Read error: 54 (Connection reset by peer)]
Skal has joined #ocaml
Skal has quit ["Client exiting"]
Skal has joined #ocaml
vezenchio has joined #ocaml
<ulfdoz_>
re
skylan has quit [Remote closed the connection]
skylan_ has joined #ocaml
Axioplase has joined #ocaml
<Axioplase>
Hi!
<Axioplase>
Why can't I "type interpoldense ={ var : string; coeffs : num array};;
<Axioplase>
" ?
<Axioplase>
it doesn't like the num array...
<Axioplase>
ah. Num.num seemd to work
skylan has joined #ocaml
skylan_ has quit [Read error: 54 (Connection reset by peer)]
<mrvn_>
never forget your namespaces
pango_ has joined #ocaml
Msandin has joined #ocaml
Msandin has quit [Read error: 131 (Connection reset by peer)]
Msandin has joined #ocaml
pango has quit [Read error: 145 (Connection timed out)]
cjohnson has joined #ocaml
<raboof>
avond
<raboof>
egh
<raboof>
cd ol;)
cmeme has quit [Remote closed the connection]
Axioplase has left #ocaml []
cmeme has joined #ocaml
cmeme has quit [Remote closed the connection]
Msandin has quit [Read error: 145 (Connection timed out)]
cmeme has joined #ocaml
cjohnson has quit [""We live like penguins in the desert...""]
jesuismoi has joined #ocaml
pango__ has joined #ocaml
Skal has quit [Remote closed the connection]
pango_ has quit [Read error: 110 (Connection timed out)]
cmeme has quit [Read error: 104 (Connection reset by peer)]
jesuismoi has quit ["Chatzilla 0.9.68a [Firefox 1.0/20041107]"]
cmeme has joined #ocaml
Submarine_ has joined #ocaml
_JusSx_ has quit ["leaving"]
_JusSx_ has joined #ocaml
Herrchen has quit ["good night"]
Submarine_ has quit ["Leaving"]
mflux_ has joined #ocaml
pango__ has quit [brown.freenode.net irc.freenode.net]
mflux has quit [brown.freenode.net irc.freenode.net]
pango__ has joined #ocaml
Hipo has joined #ocaml
_JusSx_ has quit ["leaving"]
<Snark>
good night
Snark has left #ocaml []
Purice has joined #ocaml
Sonarman has quit [Read error: 110 (Connection timed out)]
Skal has joined #ocaml
Purice has quit ["Leaving"]
Sonarman has joined #ocaml
gub has joined #ocaml
gub has quit [Client Quit]
Smerdyakov has joined #ocaml
Sonarman has quit [Read error: 110 (Connection timed out)]
Skal has quit ["Client exiting"]
Smerdyakov has quit []
<ulfdoz_>
bye
<Gueben>
bye
<vincenz>
raboof: belgian?
<raboof>
vincenz: dutch :)
<vincenz>
aha
vezenchio has quit [Read error: 145 (Connection timed out)]