digitalmars.D - version - feature suggestions
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (19/47) Oct 18 2004 Two features seems to be missing from versions:
- Ivan Senji (8/32) Oct 18 2004 Can't you write that as
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (10/43) Oct 18 2004 becomes
-
Walter
(4/11)
Oct 19 2004
. Actually, the idea here is that versions should represent something - =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (7/9) Oct 20 2004 They were being used as:
- Sean Kelly (4/27) Oct 19 2004 It would be nice to have full expression logic in version and debug
- Walter (4/6) Oct 19 2004 These casings were picked to match the casings used by the C compilers o...
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (9/14) Oct 20 2004 Couldn't *both* versions be defined ? As in:
- Regan Heath (9/23) Oct 20 2004 I'd prefer if it was simply case insensitive.
- J C Calvarese (20/33) Oct 21 2004 I don't want the version identifiers to be case insensitive, but there's...
- Regan Heath (15/33) Oct 21 2004 At least if they're consistent we don't have to guess what they are.
- Burton Radons (19/28) Oct 21 2004 All that that means is that the C method was an ungodly mess that should...
Two features seems to be missing from versions: 1) reversing the condition This C maps rather easily into D:#ifdef SOMETHING // do stuff #endifas:version (SOMETHING) { // do stuff }This does not:#ifndef SOMETHING // do stuff #endifThe current D workaround:version (SOMETHING) version = SOMETHING; else version = not_SOMETHING; version (not_SOMETHING) { // do stuff }That quickly gets boring to write... * Suggestion: version (!SOMETHING) 2) numbered versions This code is kinda hard to "translate" :#define VERSION 2 #if (VERSION > 2) // do stuff #endifCurrent workaround in D:version = VERSION_1; version = VERSION_2; version (VERSION_2) { // do stuff }Again, it gets boring around 10 or so. * Suggestion: version (VERSION > 2) What do you think ? (am I missing something?) --anders PS. Another little ugliness is the casing: "Windows" versus "linux" versus "darwin" Perhaps we should ask the compilers to define *both* lowercase and CamelCase ?
Oct 18 2004
"Anders F Björklund" <afb algonet.se> wrote in message news:cl0s4t$hs1$1 digitaldaemon.com...Two features seems to be missing from versions: 1) reversing the condition This C maps rather easily into D:Can't you write that as version(SOMETHING){} else { // do stuff }#ifdef SOMETHING // do stuff #endifas:version (SOMETHING) { // do stuff }This does not:#ifndef SOMETHING // do stuff #endifThe current D workaround:version (SOMETHING) version = SOMETHING; else version = not_SOMETHING; version (not_SOMETHING) { // do stuff }...
Oct 18 2004
Ivan Senji wrote:Hehe, yup - you are perfectly right there ! :-)The current D workaround:Can't you write that as version(SOMETHING){} else { // do stuff }version (SOMETHING) version = SOMETHING; else version = not_SOMETHING; version (not_SOMETHING) { // do stuff }#ifndef SOMETHING // do stuff #endifbecomesversion (SOMETHING) {} else { // do stuff }A little obscure, but better than my workaround... The only problem is that I now have the following:#ifndef SOMETHING // do stuff #else // do something else #endifI'd prefer *not* to swap them, since it's ported C. The previous workaround still holds here, though:version (not_SOMETHING) { // do stuff } else { // do something else }I can use the short workaround for most, and long for rest. --anders PS. It was for glext.h
Oct 18 2004
"Anders F Björklund" <afb algonet.se> wrote in message news:cl17lu$ujq$1 digitaldaemon.com...<g>. Actually, the idea here is that versions should represent something positive, like DO_THIS_FEATURE rather than "DO_NOT_DO_THIS_FEATURE".Can't you write that as version(SOMETHING){} else { // do stuff }Hehe, yup - you are perfectly right there ! :-)
Oct 19 2004
Walter wrote:<g>. Actually, the idea here is that versions should represent something positive, like DO_THIS_FEATURE rather than "DO_NOT_DO_THIS_FEATURE".They were being used as: if (SANE) {} else { // activate ugly workaround } So it was kinda positive ? :) --anders
Oct 20 2004
Anders F Björklund wrote:Two features seems to be missing from versions: 1) reversing the condition This C maps rather easily into D:It would be nice to have full expression logic in version and debug statements, assuming we don't already. Sean#ifdef SOMETHING // do stuff #endifas:version (SOMETHING) { // do stuff }This does not:#ifndef SOMETHING // do stuff #endif
Oct 19 2004
"Anders F Björklund" <afb algonet.se> wrote in message news:cl0s4t$hs1$1 digitaldaemon.com...PS. Another little ugliness is the casing: "Windows" versus "linux" versus "darwin"These casings were picked to match the casings used by the C compilers on the corresponding systems.
Oct 19 2004
Walter wrote:Couldn't *both* versions be defined ? As in: windows,Windows,linux,Linux,darwin,Darwin, etc. Since both Win32 and Windows are being used now ? Also suggested a "MacOSX" to David Friedman (gdc) --anders PS. It's mostly an aesthetic issue, although loader.d was broken... (as it uses version(Linux) now)PS. Another little ugliness is the casing: "Windows" versus "linux" versus "darwin"These casings were picked to match the casings used by the C compilers on the corresponding systems.
Oct 20 2004
On Wed, 20 Oct 2004 14:47:53 +0200, Anders F Björklund <afb algonet.se> wrote:Walter wrote:I'd prefer if it was simply case insensitive. I know D is case sensitive, and that we like to have consistency, but, I think this is another instance where breaking from the trend is the RightThing(TM). Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/Couldn't *both* versions be defined ? As in: windows,Windows,linux,Linux,darwin,Darwin, etc. Since both Win32 and Windows are being used now ? Also suggested a "MacOSX" to David Friedman (gdc) --anders PS. It's mostly an aesthetic issue, although loader.d was broken... (as it uses version(Linux) now)PS. Another little ugliness is the casing: "Windows" versus "linux" versus "darwin"These casings were picked to match the casings used by the C compilers on the corresponding systems.
Oct 20 2004
Regan Heath wrote:On Wed, 20 Oct 2004 14:47:53 +0200, Anders F Björklund <afb algonet.se>...I don't want the version identifiers to be case insensitive, but there's no good reason why the the predefined versions shouldn't be consistent. Mixed case (I prefer this)... version(Windows) version(Linux) version(MacOSX) version(Darwin) or all lowercase... version(windows) version(linux) version(macosx) Some of each hurts my eyes... version(Windows) version(linux) You might as well write, "Open the Door to let roger in." -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/PS. It's mostly an aesthetic issue, although loader.d was broken... (as it uses version(Linux) now)I'd prefer if it was simply case insensitive. I know D is case sensitive, and that we like to have consistency, but, I think this is another instance where breaking from the trend is the RightThing(TM). Regan
Oct 21 2004
On Thu, 21 Oct 2004 22:34:58 -0500, J C Calvarese <jcc7 cox.net> wrote:Regan Heath wrote:Why not?On Wed, 20 Oct 2004 14:47:53 +0200, Anders F Björklund <afb algonet.se>...I don't want the version identifiers to be case insensitive,PS. It's mostly an aesthetic issue, although loader.d was broken... (as it uses version(Linux) now)I'd prefer if it was simply case insensitive. I know D is case sensitive, and that we like to have consistency, but, I think this is another instance where breaking from the trend is the RightThing(TM). Reganbut there's no good reason why the the predefined versions shouldn't be consistent.At least if they're consistent we don't have to guess what they are. My reasoning for making them case insensitive is that it becomes less possible for a typo to cause trouble. i.e. version (windows) version (WINDOWS) version (Windows) version (WiNdOwS) will all work. No guessing, just spell it write (joke intentional) and it will work as intended. Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Oct 21 2004
Walter wrote:"Anders F Björklund" <afb algonet.se> wrote in message news:cl0s4t$hs1$1 digitaldaemon.com...All that that means is that the C method was an ungodly mess that should be sorted out by a sensible and consistent New Way: Compiler.DigitalMars Compiler.GDC Compiler.DNET Processor.X86 Processor.AMD64 Processor.Endian.Big Processor.Endian.Little OS.Windows OS.Linux Asm.X86 None There should also be versions describing such details as what kind of calling convention is used by the compiler for D linking to reduce potential for assumptions (false assumptions are the cause of all accidents.) As it is, there is no way to prove that an asm statement is safe; therefore, they cannot be put in robust libraries.PS. Another little ugliness is the casing: "Windows" versus "linux" versus "darwin"These casings were picked to match the casings used by the C compilers on the corresponding systems.
Oct 21 2004