February 15, 2002 Re: Read This One | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | Ok, that's a good idea. "Pavel Minayev" <evilone@omen.ru> wrote in message news:a4jqcr$20o0$1@digitaldaemon.com... > Define a processor family identificator, so it is possible to write: > > asm > { > version (i386) > ... > else version (alpha) > ... > ... > } > > Would help to write _fast_ cross-platform thingies. Like GNU's bignum, GMP... |
February 20, 2002 Re: Read This One | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | I agree that it should be done in streams, but that is not the only place. What if someone uses their own stream functions? What about interfacing with legacy code that has explicit endianness? Default endianness is the one that is defined by the system. Mac has a different default endianness than pc. "Walter" <walter@digitalmars.com> wrote in message news:a4je38$1qhv$2@digitaldaemon.com... > > "Pavel Minayev" <evilone@omen.ru> wrote in message news:a3lk7q$sfb$1@digitaldaemon.com... > > "D" <s_nudds@hotmail.com> wrote in message news:a3ldt4$nel$1@digitaldaemon.com... > > > Default Endian isn't explicitly required. > > > > > > Endian conversions have value only for I/O. And I/O is closely > associated > > > with the passing of structures between machines. > > > > For file (and general stream) I/O, I'll add conversion functions to my Stream class. It'd work like this: > > > > File file; > > ... > > file.writeBE(666); // big-endian > > file.writeLE(666); // lil-endian > > I agree doing it in the streams is the right place. > > |
February 20, 2002 Re: Read This One | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian Bober | "Brian Bober" <netdemonz@yahoo.com> wrote in message news:a50spc$18g4$1@digitaldaemon.com... > I agree that it should be done in streams, but that is not the only place. What if someone uses their own stream functions? What about interfacing with > legacy code that has explicit endianness? D legacy code should have no "explicit endianness" (because there is a standard way to determine it if needed). For C code, you will have to use explicit conversion - which is as easy as writing a one-line version'ed function, which than gets inlined by the compiler. |
Copyright © 1999-2021 by the D Language Foundation