www.digitalmars.com         C & C++   DMDScript  

D - Labeled statement and empty statement

reply "Martin M. Pedersen" <martin moeller-pedersen.dk> writes:
Hi,

In C it is common to see functions like this:

    void foo(void)
    {
        // do something useful
        if (error) {
            goto done;
        }
        // do something useful
    done:
        // clean up
    }

In are more concrete example, it could end like this:

        ...
    done:
        fclose(fp);
        free(ptr);
    }

The code is maintained, and for some reason there is no need for fclose()
and free() anymore. But there are numerous goto's to the label, and we want
to keep the single exit point. So it is changed to:

        ...
    done:
    }

But this will not compile, because there is no statement after "done:". In C
we need to use the empty statement like this:

        ...
    done:
        ;
    }

Silly, isn't it? In D, if the documentation is correct, it is even worse,
because there is no empty statement. So we need to write something like:

        ...
    done:
        { }
    }

or
        ...
    done:
        0;
    }

But it appears that DMD actually implements the empty statement, so the
documentation and DMD is out of sync here.
I just wish there was no need for the empty statement. It t would be more
elegant if labels didn't need to prefix a statement.


Regards,
Martin
Aug 14 2003
next sibling parent "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Martin M. Pedersen" <martin moeller-pedersen.dk> wrote in message
news:bhgbl8$ac3$1 digitaldaemon.com...
 Hi,

 In C it is common to see functions like this:

     void foo(void)
     {
         // do something useful
         if (error) {
             goto done;
         }
         // do something useful
     done:
         // clean up
     }

 In are more concrete example, it could end like this:

         ...
     done:
         fclose(fp);
         free(ptr);
     }

 The code is maintained, and for some reason there is no need for fclose()
 and free() anymore. But there are numerous goto's to the label, and we
want
 to keep the single exit point. So it is changed to:

         ...
     done:
     }

 But this will not compile, because there is no statement after "done:". In
C
 we need to use the empty statement like this:

         ...
     done:
         ;
     }

 Silly, isn't it? In D, if the documentation is correct, it is even worse,
 because there is no empty statement. So we need to write something like:

         ...
     done:
         { }
     }

 or
         ...
     done:
         0;
     }

 But it appears that DMD actually implements the empty statement, so the
 documentation and DMD is out of sync here.
 I just wish there was no need for the empty statement. It t would be more
 elegant if labels didn't need to prefix a statement.
you should use a labled block and change your goto's to a break done : { .... if ( error ) { break done; } ... return; } // clean up. or if you want to be more OO change it to try { if ( error ) { throw new Exception(); } // or a staticly held exception if you worred about performance } catch( Exception e ) { } // [finally ....]
Aug 14 2003
prev sibling parent reply "Charles Sanders" <sanders-consulting comcast.net> writes:
 It t would be more
 elegant if labels didn't need to prefix a statement.
It would be more elegenat if you didnt use goto's :P. Charles "Martin M. Pedersen" <martin moeller-pedersen.dk> wrote in message news:bhgbl8$ac3$1 digitaldaemon.com...
 Hi,

 In C it is common to see functions like this:

     void foo(void)
     {
         // do something useful
         if (error) {
             goto done;
         }
         // do something useful
     done:
         // clean up
     }

 In are more concrete example, it could end like this:

         ...
     done:
         fclose(fp);
         free(ptr);
     }

 The code is maintained, and for some reason there is no need for fclose()
 and free() anymore. But there are numerous goto's to the label, and we
want
 to keep the single exit point. So it is changed to:

         ...
     done:
     }

 But this will not compile, because there is no statement after "done:". In
C
 we need to use the empty statement like this:

         ...
     done:
         ;
     }

 Silly, isn't it? In D, if the documentation is correct, it is even worse,
 because there is no empty statement. So we need to write something like:

         ...
     done:
         { }
     }

 or
         ...
     done:
         0;
     }

 But it appears that DMD actually implements the empty statement, so the
 documentation and DMD is out of sync here.
 I just wish there was no need for the empty statement. It t would be more
 elegant if labels didn't need to prefix a statement.


 Regards,
 Martin
Aug 14 2003
parent reply "Martin M. Pedersen" <martin moeller-pedersen.dk> writes:
"Charles Sanders" <sanders-consulting comcast.net> wrote in message
news:bhgdqv$cfh$1 digitaldaemon.com...
 It would be more elegenat if you didnt use goto's :P.
I know, but still, "goto" is part of the language. Regards, Martin
Aug 14 2003
next sibling parent reply Derek Parnell <derek.parnell no.spam> writes:
On Thu, 14 Aug 2003 19:34:43 +0200 (08/15/03 03:34:43)
, Martin M. Pedersen <martin moeller-pedersen.dk> wrote:

 "Charles Sanders" <sanders-consulting comcast.net> wrote in message
 news:bhgdqv$cfh$1 digitaldaemon.com...
 It would be more elegenat if you didnt use goto's :P.
I know, but still, "goto" is part of the language.
Yes, but that neither compels you to use it, or to make it a part of your 'language'. -- Derek
Aug 14 2003
next sibling parent reply "Frank D. Wills" <fdwills sandarh.com> writes:
I suppose the goto statement isn't a big issue, but it's the
first thing I would want to remove from all languages except
it's equivalent, the jump statement on assembler, where it's
needed. Otherwise nothing worse or uglier than a goto statement.


Derek Parnell wrote:
 On Thu, 14 Aug 2003 19:34:43 +0200 (08/15/03 03:34:43)
 , Martin M. Pedersen <martin moeller-pedersen.dk> wrote:
 
 "Charles Sanders" <sanders-consulting comcast.net> wrote in message
 news:bhgdqv$cfh$1 digitaldaemon.com...

 It would be more elegenat if you didnt use goto's :P.
I know, but still, "goto" is part of the language.
Yes, but that neither compels you to use it, or to make it a part of your 'language'.
Aug 14 2003
next sibling parent reply "Vathix" <vathix dprogramming.com> writes:
I like goto.

"Frank D. Wills" <fdwills sandarh.com> wrote in message
news:bhh9ic$1853$1 digitaldaemon.com...
 I suppose the goto statement isn't a big issue, but it's the
 first thing I would want to remove from all languages except
 it's equivalent, the jump statement on assembler, where it's
 needed. Otherwise nothing worse or uglier than a goto statement.


 Derek Parnell wrote:
 On Thu, 14 Aug 2003 19:34:43 +0200 (08/15/03 03:34:43)
 , Martin M. Pedersen <martin moeller-pedersen.dk> wrote:

 "Charles Sanders" <sanders-consulting comcast.net> wrote in message
 news:bhgdqv$cfh$1 digitaldaemon.com...

 It would be more elegenat if you didnt use goto's :P.
I know, but still, "goto" is part of the language.
Yes, but that neither compels you to use it, or to make it a part of your 'language'.
Aug 14 2003
parent reply Derek Parnell <derek.parnell no.spam> writes:
On Fri, 15 Aug 2003 00:49:10 -0400 (08/15/03 14:49:10)
, Vathix <vathix dprogramming.com> wrote:

 I like goto.
And I like McDonald's BigMacs, but it doesn't mean they're good for me. -- Derek
Aug 14 2003
parent reply "Matthew Wilson" <matthew stlsoft.org> writes:
 I like goto.
And I like McDonald's BigMacs, but it doesn't mean they're good for me.
Your analogy is not well founded. There are no circumstances under which a Big Mac is appropriate. Even if you do eat meat (though I cannot imagine anyone wishing to do so), then there are better forms of meat. Even if you do need a hamburgler, then there are less mass-produced, healthier, and (from what my carnivorous friends tell me) tastier alternatives. What we're talking about here is something that is almost always bad, but sometimes very good. A better analogy in this case would be a can of Coke. Bad in almost all conceivable circumstances, but if you've got a cycling-<substitute your sport of choice here, so long as it's not golf!>-headache, then the combination of water, high concentration of simple carbohydrates and big shot of caffeine are exactly appropriate. Rehydrates, gives your brain some well needed carbs, and opens up the blood vessels in the old grey matter to assuage the ache until the rehydration kicks in. Marvellous! Derek the Dietician
Aug 15 2003
next sibling parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Matthew Wilson" <matthew stlsoft.org> wrote in message
news:bhi0gn$1uf0$3 digitaldaemon.com...
 I like goto.
And I like McDonald's BigMacs, but it doesn't mean they're good for me.
Your analogy is not well founded. There are no circumstances under which a Big Mac is appropriate. Even if you do eat meat (though I cannot imagine anyone wishing to do so), then there are better forms of meat. Even if you do need a hamburgler, then there are less mass-produced, healthier, and (from what my carnivorous friends tell me) tastier alternatives.
I think the analogy is actual perfect, and proved by your responce, unless you see goto as a good "meat" !
Aug 15 2003
parent reply "Matthew Wilson" <matthew stlsoft.org> writes:
 I like goto.
And I like McDonald's BigMacs, but it doesn't mean they're good for
me.
 Your analogy is not well founded. There are no circumstances under which
a
 Big Mac is appropriate. Even if you do eat meat (though I cannot imagine
 anyone wishing to do so), then there are better forms of meat. Even if
you
 do need a hamburgler, then there are less mass-produced, healthier, and
 (from what my carnivorous friends tell me) tastier alternatives.
I think the analogy is actual perfect, and proved by your responce, unless you see goto as a good "meat" !
I don't eat any dead walking (or flying) things, so cannot say that I do. ;)
Aug 15 2003
next sibling parent reply "DeadCow" <deadcow-remove-this free.fr> writes:
"Matthew Wilson" <matthew stlsoft.org> a écrit dans le message news:
bhi9p8$27a0$1 digitaldaemon.com...

 I don't eat any dead walking (or flying) things, so cannot say that I do.
;) what about swiming ones ? -- Nicolas Repiquet
Aug 15 2003
parent reply "Matthew Wilson" <matthew stlsoft.org> writes:
 what about swiming ones ?
Of course. I'm not an idiot! ;) Yum yum
Aug 15 2003
parent Ilya Minkov <midiclub 8ung.at> writes:
"I think fish is nice, but then I think rain is wet, so who am I to judge?"

- words of the one who rules the universe, from Douglas Adams' "The 
Restaurant at the End of the Universe"
Aug 22 2003
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"Matthew Wilson" <matthew stlsoft.org> wrote in message
news:bhi9p8$27a0$1 digitaldaemon.com...
 I don't eat any dead walking (or flying) things, so cannot say that I do.
;) I don't eat any of the walking dead zombies, either. I poke 'em with a fork first to make sure they really are truly dead before eating them. Nothing like having your dead dinner up and walk away.
Aug 15 2003
parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:bhjp68$htd$3 digitaldaemon.com...
 "Matthew Wilson" <matthew stlsoft.org> wrote in message
 news:bhi9p8$27a0$1 digitaldaemon.com...
 I don't eat any dead walking (or flying) things, so cannot say that I
do.
 ;)

 I don't eat any of the walking dead zombies, either. I poke 'em with a
fork
 first to make sure they really are truly dead before eating them. Nothing
 like having your dead dinner up and walk away.
poke 'em with a fork, .. never, fry them! then you can be sure!
Aug 15 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
news:bhjqsn$jdo$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> wrote in message
 news:bhjp68$htd$3 digitaldaemon.com...
 "Matthew Wilson" <matthew stlsoft.org> wrote in message
 news:bhi9p8$27a0$1 digitaldaemon.com...
 I don't eat any dead walking (or flying) things, so cannot say that I
do.
 ;)
 I don't eat any of the walking dead zombies, either. I poke 'em with a
fork
 first to make sure they really are truly dead before eating them.
Nothing
 like having your dead dinner up and walk away.
poke 'em with a fork, .. never, fry them! then you can be sure!
Good idea. I'll stuff them in my deep fat frier. If they try to get out, I'll bash 'em over the head with a goto!
Aug 15 2003
parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:bhjs4o$khu$2 digitaldaemon.com...
 "Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
 news:bhjqsn$jdo$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> wrote in message
 news:bhjp68$htd$3 digitaldaemon.com...
 "Matthew Wilson" <matthew stlsoft.org> wrote in message
 news:bhi9p8$27a0$1 digitaldaemon.com...
 I don't eat any dead walking (or flying) things, so cannot say that
I
 do.
 ;)
 I don't eat any of the walking dead zombies, either. I poke 'em with a
fork
 first to make sure they really are truly dead before eating them.
Nothing
 like having your dead dinner up and walk away.
poke 'em with a fork, .. never, fry them! then you can be sure!
Good idea. I'll stuff them in my deep fat frier. If they try to get out, I'll bash 'em over the head with a goto!
no! you should continue hitting them until they break, or throw them out as an exception!
Aug 15 2003
parent "Walter" <walter digitalmars.com> writes:
"Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
news:bhjs9u$ksp$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> wrote in message
 news:bhjs4o$khu$2 digitaldaemon.com...
 "Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
 news:bhjqsn$jdo$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> wrote in message
 news:bhjp68$htd$3 digitaldaemon.com...
 "Matthew Wilson" <matthew stlsoft.org> wrote in message
 news:bhi9p8$27a0$1 digitaldaemon.com...
 I don't eat any dead walking (or flying) things, so cannot say
that I
 do. ;)
 I don't eat any of the walking dead zombies, either. I poke 'em with
a fork
 first to make sure they really are truly dead before eating them.
Nothing
 like having your dead dinner up and walk away.
poke 'em with a fork, .. never, fry them! then you can be sure!
Good idea. I'll stuff them in my deep fat frier. If they try to get out, I'll bash 'em over the head with a goto!
no! you should continue hitting them until they break, or throw them out
as
 an exception!
I concede defeat! You are the master!
Aug 15 2003
prev sibling next sibling parent reply John Reimer <jjreimer telus.net> writes:
Matthew Wilson wrote:

 
 Your analogy is not well founded. There are no circumstances under which a
 Big Mac is appropriate. Even if you do eat meat (though I cannot imagine
 anyone wishing to do so), then there are better forms of meat. Even if you
 do need a hamburgler, then there are less mass-produced, healthier, and
 (from what my carnivorous friends tell me) tastier alternatives.
Oh I can't resist... Hamburger is definitely bad bad bad. But there are some meats (like fish) that are very good for you. This was a programming discussion, wasn't it? :)
 What we're talking about here is something that is almost always bad, but
 sometimes very good. A better analogy in this case would be a can of Coke.
 Bad in almost all conceivable circumstances, but if you've got a
 cycling-<substitute your sport of choice here, so long as it's not
 golf!>-headache, then the combination of water, high concentration of simple
 carbohydrates and big shot of caffeine are exactly appropriate. Rehydrates,
 gives your brain some well needed carbs, and opens up the blood vessels in
 the old grey matter to assuage the ache until the rehydration kicks in.
 Marvellous!
Well that's kind of accurate, but I'd say that my brain will not be the thing so starving for carbs. It gets just as much as it needs. As a runner, my legs will be grabbing all the sugars they can get first. In fact, I'd say my brain goes into a minimal carb burn state on long runs -- zombie style. Caffeine does help for endurance, I here. Although, if you ever run, you'll NEVER want to have a carbonated drink. The...um... "air bubbles" really get in the way of breathing -- really. Drink juice instead. Otherwise the coke analogy sounded more like a euphemism for a bad habit ;). I still have trouble believing the volatile concoction called "Coca Cola" can be good for you in any situation. For the athlete, the only thing going for it is the fact that it contains sugar and water. There are plenty of things that have sugar and water and in a better form too. Now how does that compare with the "goto"? :)
 
 Derek the Dietician
 
 
Matthew Wilson, the man of many names, I've noticed :). Later, John
Aug 15 2003
next sibling parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"John Reimer" <jjreimer telus.net> wrote in message
news:bhjd2s$5ob$1 digitaldaemon.com...
 Matthew Wilson wrote:
 What we're talking about here is something that is almost always bad,
but
 sometimes very good. A better analogy in this case would be a can of
Coke.
 Bad in almost all conceivable circumstances, but if you've got a
 cycling-<substitute your sport of choice here, so long as it's not
 golf!>-headache, then the combination of water, high concentration of
simple
 carbohydrates and big shot of caffeine are exactly appropriate.
Rehydrates,
 gives your brain some well needed carbs, and opens up the blood vessels
in
 the old grey matter to assuage the ache until the rehydration kicks in.
 Marvellous!
Well that's kind of accurate, but I'd say that my brain will not be the thing so starving for carbs. It gets just as much as it needs. As a runner, my legs will be grabbing all the sugars they can get first. In fact, I'd say my brain goes into a minimal carb burn state on long runs -- zombie style. Caffeine does help for endurance, I here. Although, if you ever run, you'll NEVER want to have a carbonated drink. The...um... "air bubbles" really get in the way of breathing -- really. Drink juice instead. Otherwise the coke analogy sounded more like a euphemism for a bad habit ;). I still have trouble believing the volatile concoction called "Coca Cola" can be good for you in any situation. For the athlete, the only thing going for it is the fact that it contains sugar and water. There are plenty of things that have sugar and water and in a better form too. Now how does that compare with the "goto"? :)
to quote the late Gary Howland : "you known Coca cola (TM) used to have cocaine in it!" and caffine is diuretic so can make you more dehydrated and I was under the impression that high dose of sugar (simple or complex) when you blood sugars are low from excersise was the worse thing to do (can cause hypoglycemia and eventually lead to type 2 diabeties) more compex carbs or proteins where better to relenish the bodys energy store (and water as the liver need water to store sugars)
Aug 15 2003
next sibling parent reply John Reimer <jjreimer telus.net> writes:
Mike Wynn wrote:

 to quote the late Gary Howland : "you known Coca cola (TM) used to have
 cocaine in it!"
 and caffine is diuretic so can make you more dehydrated
Caffiene is indeed a diuretic, which would not seem good for an endurance athlete, except that athletes are very efficient creatures cardiovascularly, so they seem to make up for it. Long term effects are probably not good for them, though.
 and I was under the impression that high dose of sugar (simple or complex)
 when you blood sugars are low from excersise was the worse thing to do (can
 cause hypoglycemia and eventually lead to type 2 diabeties) more compex
 carbs or proteins where better to relenish the bodys energy store (and water
 as the liver need water to store sugars)
 
I don't know what you mean by the high sugars causing hypoglycemia. In a fit person doing intense, long duration exercise, sugar of almost all kinds is burned up like crazy as the muscles desperately scrounge for any fuel they can get. This burning does not cause hypoglycemia. These people are too healthy for something like that too happen. These people NEED the sugars after a hard workout. I'll just clarify that I'm talking about a athlete that trains hard everyday. Most people that just do periodic fitness, definitely don't need to go on a sugar binge after a workout. Few people work out hard enough to need those sugars. But those people that work out are still less likely to get diabetes then those that don't. The biggest cause of type II diabetes is found in inactive humans that eat lots of sugars of all types and refined foods (ie Western diet). They don't burn it or burn very little, so it either goes to fat, or over time the sugars overload the pancreas (which produces the insulin necessary to metabolize carbohydrates). Eventually sugars build up in the blood stream to dangerously high levels -- hyperglycemia. The viscous nature of blood with high glucose levels causes a veritable slowing of the blood. It becomes syrupy, and the first place to notice this happening is the brain which starts starving for sugar and oxygen (yes the brain actually can't get the sugar it needs!). Typcal symptoms of a hyperglycemic person is quite naturally drowsiness and lethargy during the day. The hyperglycemic state is usually the first big sign of type II diabetes. The term "HYPOglycemia" has actually nothing to do with the onset of diabetes. It's a state of low blood sugar that typically occurs when a diabetic takes his/her insulin shot (or a oral hypoglycemic) without eating some food to compensate for the effect. So the medication knocks the blood sugars to dangerously low levels. This is a side affect of medicated diabetics. It is not related to the disease itself. This is a common confusion. Oh by the way... the cure for diabetes type II is quite simple: prevention. Don't eat the western diet. Don't eat lots of sugars, especially the refined stuff, unless you are a crazy athlete. Exercise lots anyway. Don't eat white flower based foods. Don't drink alcohol or, at least, keep it to a minimum. Eat fruit, vegetables, whole grains, some meats, and exercise at least an hour a day. Oh and never, never, never, smoke. Diabetes is one of the ugliest diseases I've seen. It leads to so many other horrible diseases including atherosclerosis, heart attacks, cerebrovascular accidents, renal failure, gangarene, and cancers. Oh and one other thing: DON'T DRINK COKE! ;) Seriously, people that live on those beverages are pickling themselves everyday with sugars that their bodies can not use and do not need. They are a diabetic waiting to happen. Of course most of this can be studied on-line somewhere. I'd say there is still a lot of misinformation out there and even the medical community doesn't always explain the source of the problem very well...it's even contorted sometimes. I really don't trust all the diabetes PR literature out there. A lot of my job as a paramedic deals with diabetics...and long time smokers. Oh well now...I've really gone on to a non-programming tangent.... It's all your fault Mike! :) So beware...beware...the western diet...and the "goto"! Later, John
Aug 15 2003
parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"John Reimer" <jjreimer telus.net> wrote in message
news:bhjicd$b50$1 digitaldaemon.com...
 Mike Wynn wrote:

 to quote the late Gary Howland : "you known Coca cola (TM) used to have
 cocaine in it!"
 and caffine is diuretic so can make you more dehydrated
Caffiene is indeed a diuretic, which would not seem good for an endurance athlete, except that athletes are very efficient creatures cardiovascularly, so they seem to make up for it. Long term effects are probably not good for them, though.
 and I was under the impression that high dose of sugar (simple or
complex)
 when you blood sugars are low from excersise was the worse thing to do
(can
 cause hypoglycemia and eventually lead to type 2 diabeties) more compex
 carbs or proteins where better to relenish the bodys energy store (and
water
 as the liver need water to store sugars)
I don't know what you mean by the high sugars causing hypoglycemia. In a fit person doing intense, long duration exercise, sugar of almost all kinds is burned up like crazy as the muscles desperately scrounge for any fuel they can get. This burning does not cause hypoglycemia. These people are too healthy for something like that too happen. These people NEED the sugars after a hard workout. I'll just clarify that I'm talking about a athlete that trains hard everyday. Most people that just do periodic fitness, definitely don't need to go on a sugar binge after a workout. Few people work out hard enough to need those sugars. But those people that work out are still less likely to get diabetes then those that don't. The biggest cause of type II diabetes is found in inactive humans that eat lots of sugars of all types and refined foods (ie Western diet). They don't burn it or burn very little, so it either goes to fat, or over time the sugars overload the pancreas (which produces the insulin necessary to metabolize carbohydrates). Eventually sugars build up in the blood stream to dangerously high levels -- hyperglycemia. The viscous nature of blood with high glucose levels causes a veritable slowing of the blood. It becomes syrupy, and the first place to notice this happening is the brain which starts starving for sugar and oxygen (yes the brain actually can't get the sugar it needs!). Typcal symptoms of a hyperglycemic person is quite naturally drowsiness and lethargy during the day. The hyperglycemic state is usually the first big sign of type II diabetes. The term "HYPOglycemia" has actually nothing to do with the onset of diabetes. It's a state of low blood sugar that typically occurs when a diabetic takes his/her insulin shot (or a oral hypoglycemic) without eating some food to compensate for the effect. So the medication knocks the blood sugars to dangerously low levels. This is a side affect of medicated diabetics. It is not related to the disease itself. This is a common confusion. Oh by the way... the cure for diabetes type II is quite simple: prevention. Don't eat the western diet. Don't eat lots of sugars, especially the refined stuff, unless you are a crazy athlete. Exercise lots anyway. Don't eat white flower based foods. Don't drink alcohol or, at least, keep it to a minimum. Eat fruit, vegetables, whole grains, some meats, and exercise at least an hour a day. Oh and never, never, never, smoke. Diabetes is one of the ugliest diseases I've seen. It leads to so many other horrible diseases including atherosclerosis, heart attacks, cerebrovascular accidents, renal failure, gangarene, and cancers. Oh and one other thing: DON'T DRINK COKE! ;) Seriously, people that live on those beverages are pickling themselves everyday with sugars that their bodies can not use and do not need. They are a diabetic waiting to happen. Of course most of this can be studied on-line somewhere. I'd say there is still a lot of misinformation out there and even the medical community doesn't always explain the source of the problem very well...it's even contorted sometimes. I really don't trust all the diabetes PR literature out there. A lot of my job as a paramedic deals with diabetics...and long time smokers.
well I guess I'm talking to the right person, I was under the impresion that eating large does of sugar forced the pancreas to produce large amounts of inculin (as you mention) the body gets used to this and so starts to over produce inculin when any sugars are ingested (loading the pancreas further) thus the persons blood sugar level bounce from high (as they eat) to too low (due to the bodies over reaction) eventually (if not dealt with by going onto a lower sugar/carb diet and avoiding "sugar hits") the pancreas gets tired and so diabettes can set in.
 Oh well now...I've really gone on to a non-programming tangent.... It's
 all your fault Mike! :)
I'll take the blame happily every news group/topic needs a scapegoat.
 So beware...beware...the western diet...and the "goto"!
should I mention result from a study in saudi arabia on kids with asthma the about 50% of the kids there grown up on a western diet, the rest on a more traditional diet the cases of children developing asthma was vastly higher umongst those on a western diet. I like a balanced diet .... its a pain when your food falls off your plate!
Aug 15 2003
parent John Reimer <jjreimer telus.net> writes:
 well I guess I'm talking to the right person,
 I was under the impresion that eating large does of sugar forced the
 pancreas to produce large amounts of inculin (as you mention) the body gets
 used to this and so starts to over produce inculin when any sugars are
 ingested (loading the pancreas further) thus the persons blood sugar level
 bounce from high (as they eat) to too low (due to the bodies over reaction)
 eventually (if not dealt with by going onto a lower sugar/carb diet and
 avoiding "sugar hits")
 the pancreas gets tired and so diabettes can set in.
 
Well, this is just one of my interests. Naturally, as a lowly paramedic, I'm no expert in this topic, just one that sees the repercussions of the disease first hand. Actually your description is mostly right. Anything I would consider wrong are probably just minor nuances in my interpretation of it. ;) It usually takes years for pancreas to get worn out. Some people, based on genetic makeup, are able to resist the effects of high sugar intake than others. Before a person gets on the gradual road to diabetes, their insulin mechanism (secreted by the islets of Langerhans in the pancreas) operate faithfully. With high sugar loads, the insulin secretion very well may increase to compensate, but it rarely would ever cause a true hypoglycemic reaction (typically anything measured << 4.0 mmol/L). There may be a "bounce" effect (being a relative term) in the blood sugars earlier on, but nothing that dangerously alters the glucose levels (in short nothing that regular humans can't handle). The real problem is later on as the pancreas does eventually become overworked and incapable of producing sufficient insulin. But it is a gradual thing. Most people that are on their way to being diabetics, as far as I know, don't notice the progressive worsening in their condition until it's severe. Any conditions that may relate to signs and symptoms of diabetes are likely clowded by other conditions, such as an obese person that gets tired and short of breath from mild exertion. That is, when (as you say) the pancreas is worn out and is no longer releasing much insulin, the blood glucose concentration continues to rise and rise. This state of hyperglycemia DOES start to cause weakness, drowsiness, and shortness of breath (diabetic ketoacidosis). When it gets really bad, people start wondering if something is really wrong and go in to get checked and then find out that they have diabetes. Others just think they are out of shape perhaps, and let their condition progress until they need an operation sometime and THEN their diabetes is accidently discovered. The newly diagnosed diabetic now has to try to control his intake of carbohydrates. The careful diet does indeed avoid refined foods and fast-burn sugars. Interestingly some people can completely modify their diet and be non-dependent on medicine. They can also have somewhat of a recovery of the insulin mechanism. From what I've seen oral hypoglycemica meds are bad news anyway. They give a false security to the patient. They seem to think they can eat anything still. So they end up going back to lifestyle of huge swings in sugar level. Food ups the glucose, meds down it. Some of these people may eventually progress to needing insulin shots as the oral hypoglycemics no longer work. It's actually quite amazing the amount of abuse that the human body can take. I can't get over how people can still keep ticking despite the diseases they are inflicted with . People may as well be athletes and abuse themselves that way, if you think of it. Sorry for rambling, I don't think I really added much more to the issue at all. But it's good to think about these things, I guess.
 should I mention result from a study in saudi arabia on kids with asthma
 the about 50% of the kids there grown up on a western diet, the rest on a
 more traditional diet
 the cases of children developing asthma was vastly higher umongst those on a
 western diet.
 
 I like a balanced diet .... its a pain when your food falls off your plate!
 
I absolutely believe this could be true. There are many asthma studies, and some could easily be related to diet. Most are related to smoking parents, though. Later, John
Aug 15 2003
prev sibling parent reply "Matthew Wilson" <matthew stlsoft.org> writes:
 to quote the late Gary Howland : "you known Coca cola (TM) used to have
 cocaine in it!"
I do. Although I think that was all stopped in the 20s, when the US went all "abstinence". Never tried the stuff, although I hear it is great the first few times. [Digression: did you know that cocaine stimulates the part (forgot the name) of the brain that responds to food and sex - the two best physical sensations, you'd have to agree - and that repeated use dulls and eventually destroys this response. If you use it long enough, you can't taste anything, and you can't enjoy sex. And your nose rots. Hmmm ... think I'll stick to my endorphins. ;)]
 and caffeine is diuretic so can make you more dehydrated
True, but I was talking about the +ve short term effects. Once you've got rid of your headache, you need to dose up on lots of good stuff: water, balanced energy drinks (the ones without Nutrasweet, of course!!!), bananas, energy bars, etc.
 and I was under the impression that high dose of sugar (simple or complex)
 when you blood sugars are low from exercise was the worse thing to do (can
 cause hypoglycaemia and eventually lead to type 2 diabetes) more complex
 carbs or proteins where better to replenish the body's energy store (and
water
 as the liver need water to store sugars)
It depends how depleted you are. When you've got to the stage that you have an exercise headache, you'll likely suck up the 150-200 calories (sorry, being English I can't think in KJ) before your Eyelets react and start releasing insulin. (My step-father is a consultant dialectician, so I'll have to run this by him to check.)
Aug 15 2003
parent reply John Reimer <jjreimer telus.net> writes:
Matthew Wilson wrote:

to quote the late Gary Howland : "you known Coca cola (TM) used to have
cocaine in it!"
I do. Although I think that was all stopped in the 20s, when the US went all "abstinence". Never tried the stuff, although I hear it is great the first few times. [Digression: did you know that cocaine stimulates the part (forgot the name) of the brain that responds to food and sex - the two best physical sensations, you'd have to agree - and that repeated use dulls and eventually destroys this response. If you use it long enough, you can't taste anything, and you can't enjoy sex. And your nose rots. Hmmm ... think I'll stick to my endorphins. ;)]
and caffeine is diuretic so can make you more dehydrated
True, but I was talking about the +ve short term effects. Once you've got rid of your headache, you need to dose up on lots of good stuff: water, balanced energy drinks (the ones without Nutrasweet, of course!!!), bananas, energy bars, etc.
and I was under the impression that high dose of sugar (simple or complex)
when you blood sugars are low from exercise was the worse thing to do (can
cause hypoglycaemia and eventually lead to type 2 diabetes) more complex
carbs or proteins where better to replenish the body's energy store (and
water
as the liver need water to store sugars)
It depends how depleted you are. When you've got to the stage that you have an exercise headache, you'll likely suck up the 150-200 calories (sorry, being English I can't think in KJ) before your Eyelets react and start releasing insulin. (My step-father is a consultant dialectician, so I'll have to run this by him to check.)
"dialectician" ? -- lol I'm no expert on these things...Just somewhat informed. There may be unusual abnormalties that can cause hypoglycemia in atheletes...but this is not a normal response. Most athletes will be smart enought to re-energize themselves before any deleterious effects occur. I can see lots of bad things happening if a person pushes himself beyond the bodies capacity. Marathoners don't have heart attacks on the course for nothing. Perhaps some longterm pancreatic damage may also occur if the body is severely exhausted. My point is hypoglycemia is not a typical precursor to type II diabetes, especially in athletes. Later, John
Aug 15 2003
parent reply "Matthew Wilson" <matthew stlsoft.org> writes:
 It depends how depleted you are. When you've got to the stage that you
have
 an exercise headache, you'll likely suck up the 150-200 calories (sorry,
 being English I can't think in KJ) before your Eyelets react and start
 releasing insulin. (My step-father is a consultant dialectician, so I'll
 have to run this by him to check.)
"dialectician" ? -- lol
diabetician <blush> Maybe it was a freudian slip
Aug 15 2003
parent John Reimer <jjreimer telus.net> writes:
Matthew Wilson wrote:
It depends how depleted you are. When you've got to the stage that you
have
an exercise headache, you'll likely suck up the 150-200 calories (sorry,
being English I can't think in KJ) before your Eyelets react and start
releasing insulin. (My step-father is a consultant dialectician, so I'll
have to run this by him to check.)
"dialectician" ? -- lol
diabetician <blush> Maybe it was a freudian slip
That was so a freudian slip...it made me laugh!
Aug 15 2003
prev sibling next sibling parent reply "Matthew Wilson" <matthew stlsoft.org> writes:
"John Reimer" <jjreimer telus.net> wrote in message
news:bhjd2s$5ob$1 digitaldaemon.com...
 Matthew Wilson wrote:

 Your analogy is not well founded. There are no circumstances under which
a
 Big Mac is appropriate. Even if you do eat meat (though I cannot imagine
 anyone wishing to do so), then there are better forms of meat. Even if
you
 do need a hamburgler, then there are less mass-produced, healthier, and
 (from what my carnivorous friends tell me) tastier alternatives.
Oh I can't resist... Hamburger is definitely bad bad bad. But there are some meats (like fish) that are very good for you. This was a programming discussion, wasn't it? :)
Don't eat dead-walking (or flying) things, but *do* eat dead swimming things. Very yummy
 What we're talking about here is something that is almost always bad,
but
 sometimes very good. A better analogy in this case would be a can of
Coke.
 Bad in almost all conceivable circumstances, but if you've got a
 cycling-<substitute your sport of choice here, so long as it's not
 golf!>-headache, then the combination of water, high concentration of
simple
 carbohydrates and big shot of caffeine are exactly appropriate.
Rehydrates,
 gives your brain some well needed carbs, and opens up the blood vessels
in
 the old grey matter to assuage the ache until the rehydration kicks in.
 Marvellous!
Well that's kind of accurate, but I'd say that my brain will not be the thing so starving for carbs. It gets just as much as it needs. As a runner, my legs will be grabbing all the sugars they can get first. In fact, I'd say my brain goes into a minimal carb burn state on long runs -- zombie style. Caffeine does help for endurance, I here.
Much truth you say. However, the brain can only metabolyse (for energy at least) carbohydrates, so when exercising hard it is very important for the brain (never mind the muscles) to get carbs.
 Although, if you ever run, you'll NEVER want to have a carbonated drink.
   The...um... "air bubbles" really get in the way of breathing -- really.
 Drink juice instead.

 Otherwise the coke analogy sounded more like a euphemism for a bad habit
 ;).
Ex bad-habit. Haven't had a coke for over 3 years. However, I am still addicted to chocolate (only the true stuff, not that English/American/Australian filthy lie of milk emulsion, but the true Swiss/Belgian/French wonderment. :).
  I still have trouble believing the volatile concoction called "Coca
 Cola" can be good for you in any situation. For the athlete, the only
 thing going for it is the fact that it contains sugar and water.  There
 are plenty of things that have sugar and water and in a better form too.
   Now how does that compare with the "goto"? :)
The v...ile concoction that is Coca Cola is bad in almost all situations. But as I said, in that one circumstance, after a 4 hour ride, when one is very dehydrated, very low on carbs, and oftentimes headachy, it can provide immediate relief of the headache while you get lots of properly sustaining and replenishing chemicals down your neck.
 Derek the Dietician
Matthew Wilson, the man of many names, I've noticed :).
I used to be a spy, for the FBI (Fat Bastards Incorporated)
Aug 15 2003
parent reply John Reimer <jjreimer telus.net> writes:
 
 Much truth you say. However, the brain can only metabolyse (for energy at
 least) carbohydrates, so when exercising hard it is very important for the
 brain (never mind the muscles) to get carbs.
 
True, carbs are the only brain fuel. I just wish I could turn it off like a computer so it wouldn't need anything. As an added bonus, I wouldn't feel the pain of steady plodding either. But I guess I still need a brain to run! :)
 The v...ile concoction that is Coca Cola is bad in almost all situations.
 But as I said, in that one circumstance, after a 4 hour ride, when one is
 very dehydrated, very low on carbs, and oftentimes headachy, it can provide
 immediate relief of the headache while you get lots of properly sustaining
 and replenishing chemicals down your neck.
 
A 4 hour ride? Oh, I'd say your body would lap up anything including Coke after that! In fact, Coke probably never tasted so good after such a long ride. I know the feeling (but I'd be craving it at 2.5 hours) :). I must say, after a long hard run (2+ hours), I can't begin to describe how wonderful a sugary sweet drink tastes...of any sort. It's a crazy experience. Later, John
Aug 15 2003
next sibling parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
"John Reimer" <jjreimer telus.net> wrote in message
news:bhjm3l$er9$1 digitaldaemon.com...
| A 4 hour ride? Oh, I'd say your body would lap up anything including
| Coke after that!  In fact, Coke probably never tasted so good after such
| a long ride.  I know the feeling (but I'd be craving it at 2.5 hours)
| :).  I must say, after a long hard run (2+ hours), I can't begin to
| describe how wonderful a sugary sweet drink tastes...of any sort.  It's
| a crazy experience.
|
| Later,
|
| John
|

I'm not much a sportsman myself. I like playing basketball, but I don't play
much often. Anyway, if you really want to feel tired, exhausted and ...
(whatever other word like those that is available) like you would never
imagine, exercise at 2800 meters above the sea (that'd be over 9000 feet).
Believe me, that sweet drink tastes much better up here.

-------------------------
Carlos Santander


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.510 / Virus Database: 307 - Release Date: 2003-08-14
Aug 15 2003
next sibling parent reply "Matthew Wilson" <matthew stlsoft.org> writes:
 I'm not much a sportsman myself. I like playing basketball, but I don't
play
 much often. Anyway, if you really want to feel tired, exhausted and ...
 (whatever other word like those that is available) like you would never
 imagine, exercise at 2800 meters above the sea (that'd be over 9000 feet).
 Believe me, that sweet drink tastes much better up here.
I know what you mean. In 1994 I carried my hulking carcass up various Le-Tour famous mountains in the Alps - L'Alpe D'Huex, Lauteret, Vars - mostly on ambition than on talent. I could hardly see the last 500 meters of the ascent of L'Alpe D'Huez, and kept asking my greyhound-build friend "are we there yet?". When he finally said yes, I simply fell sideways and the world went black. Ambition satisfied, we descended straight (well, once my eyes, ears and sense of balance returned) back into D'ourg D'oisans, where I sat and ate cakes for four hours while he rode solo the 70 miles back to the car. (I wasn't going any further that day!) I plan to do it all again, minus the collapse, in a couple of years, once I've stopped sitting in a chair writing a book, and am back to a modicum of fitness.
Aug 15 2003
parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
"Matthew Wilson" <matthew stlsoft.org> wrote in message
news:bhjvng$nt4$1 digitaldaemon.com...
|
| I know what you mean. In 1994 I carried my hulking carcass up various
| Le-Tour famous mountains in the Alps - L'Alpe D'Huex, Lauteret, Vars -
| mostly on ambition than on talent. I could hardly see the last 500 meters
of
| the ascent of L'Alpe D'Huez, and kept asking my greyhound-build friend
"are
| we there yet?". When he finally said yes, I simply fell sideways and the
| world went black. Ambition satisfied, we descended straight (well, once my
| eyes, ears and sense of balance returned) back into D'ourg D'oisans, where
I
| sat and ate cakes for four hours while he rode solo the 70 miles back to
the
| car. (I wasn't going any further that day!)
|
| I plan to do it all again, minus the collapse, in a couple of years, once
| I've stopped sitting in a chair writing a book, and am back to a modicum
of
| fitness.
|

[Touristic cheap plug alert]

My suggestion: South America. Ecuador in particular. You get all the
mountains you want (you can get as high as 6310 meters) all surrounded with
beautiful landscapes. If you get tired of that, you have either rainforest
at the east or coast at the west, all beautiful, with the most exotic
creatures from this side of the universe. Finally, you can go to rest to the
Galapagos Islands and see some extraordinary animals and plants. (FYI, those
are the same islands where Charles Darwin finally came up with his evolution
theory)

I could write even more, but I think today has been a really non-D day in
this ng.

—————————————————————————
Carlos Santander


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.510 / Virus Database: 307 - Release Date: 2003-08-14
Aug 15 2003
parent "Matthew Wilson" <matthew stlsoft.org> writes:
"Carlos Santander B." <carlos8294 msn.com> wrote in message
news:bhk1tq$ppe$1 digitaldaemon.com...
 "Matthew Wilson" <matthew stlsoft.org> wrote in message
 news:bhjvng$nt4$1 digitaldaemon.com...
 |
 | I know what you mean. In 1994 I carried my hulking carcass up various
 | Le-Tour famous mountains in the Alps - L'Alpe D'Huex, Lauteret, Vars -
 | mostly on ambition than on talent. I could hardly see the last 500
meters
 of
 | the ascent of L'Alpe D'Huez, and kept asking my greyhound-build friend
 "are
 | we there yet?". When he finally said yes, I simply fell sideways and the
 | world went black. Ambition satisfied, we descended straight (well, once
my
 | eyes, ears and sense of balance returned) back into D'ourg D'oisans,
where
 I
 | sat and ate cakes for four hours while he rode solo the 70 miles back to
 the
 | car. (I wasn't going any further that day!)
 |
 | I plan to do it all again, minus the collapse, in a couple of years,
once
 | I've stopped sitting in a chair writing a book, and am back to a modicum
 of
 | fitness.
 |

 [Touristic cheap plug alert]

 My suggestion: South America. Ecuador in particular. You get all the
 mountains you want (you can get as high as 6310 meters) all surrounded
with
 beautiful landscapes. If you get tired of that, you have either rainforest
 at the east or coast at the west, all beautiful, with the most exotic
 creatures from this side of the universe. Finally, you can go to rest to
the
 Galapagos Islands and see some extraordinary animals and plants. (FYI,
those
 are the same islands where Charles Darwin finally came up with his
evolution
 theory)
Sounds fantastic. My mum & stepfather have been to the Galapagos - he's a bit of a naturalist at heart - and they say it is almost out of this world. Maybe when the mortgage is paid, and the kids are old enough to stay at grandma's. :)
 I could write even more, but I think today has been a really non-D day in
 this ng.
Well, it's the weekend ... I thought it was all a pleasant distraction, until it's got all sticky in the last few posts. :(
 -------------------------
 Carlos Santander


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.510 / Virus Database: 307 - Release Date: 2003-08-14
Aug 15 2003
prev sibling parent reply John Reimer <jjreimer telus.net> writes:
Carlos Santander B. wrote:


 I'm not much a sportsman myself. I like playing basketball, but I don't play
 much often. Anyway, if you really want to feel tired, exhausted and ...
 (whatever other word like those that is available) like you would never
 imagine, exercise at 2800 meters above the sea (that'd be over 9000 feet).
 Believe me, that sweet drink tastes much better up here.
 
That's a recognized training technique: run at high elevations to help adapt the body to operating on low oxygen levels. That's a painful but effective way to train. I can imagine you would feel like superman at sea-level after that. I have a bit of elevation training here, just because it's where I live, but it's only about 1000 feet asl. I can't imagine doing it at 2800 M -- I would definitely become hypoxic :-P. A bottle of oxygen would be sweet enough drink for me! I love the idea of running through mountains, though, especially if there's somewhere to GOTO swim afterwords! Later, John
Aug 15 2003
parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
"John Reimer" <jjreimer telus.net> wrote in message
news:bhk2o4$qme$1 digitaldaemon.com...
| That's a recognized training technique: run at high elevations to help
| adapt the body to operating on low oxygen levels.  That's a painful but
| effective way to train.  I can imagine you would feel like superman at
| sea-level after that.  I have a bit of elevation training here, just

Actually, no. I've only lived here for 3 1/2 years now, and I'm not adapted
to it. If you ask why, I had some kind of asthma or something years ago and
I never fully recovered.

| because it's where I live, but it's only about 1000 feet asl.  I can't
| imagine doing it at 2800 M -- I would definitely become hypoxic :-P.  A
| bottle of oxygen would be sweet enough drink for me!

Over here, we love football (that's soccer, for the american ones), and
there're international events all the time. In Brazil, Argentina, Uruguay,
etc., there aren't really high mountains, so when they come to play over
here (especially the argentinians, no kidding) they complain a lot. I've
heard of cases when foreign teams have come with oxygen and they use it in
the half time.

The hardest thing is that you can barely feel you sweat, because of the
humidity (I don't know how that works, I'm just repeating what I've read).
So, people who don't know about that, keep training for a couple of hours
without drinking anything because they don't think they need it. After a
while, they're dehydratated. Now that I think about, it happened to me once
(but because I had nothing to drink, not because I thought I didn't need
it)... lol

|
| I love the idea of running through mountains, though, especially if
| there's somewhere to GOTO swim afterwords!

lol

|
| Later,
|
| John
|

-------------------------
Carlos Santander


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.510 / Virus Database: 307 - Release Date: 2003-08-14
Aug 15 2003
parent John Reimer <jjreimer telus.net> writes:
 Actually, no. I've only lived here for 3 1/2 years now, and I'm not adapted
 to it. If you ask why, I had some kind of asthma or something years ago and
 I never fully recovered.
I can see that being very hard on you, then! Asthma is bad enough at sea level!
 
 The hardest thing is that you can barely feel you sweat, because of the
 humidity (I don't know how that works, I'm just repeating what I've read).
 So, people who don't know about that, keep training for a couple of hours
 without drinking anything because they don't think they need it. After a
 while, they're dehydratated. Now that I think about, it happened to me once
 (but because I had nothing to drink, not because I thought I didn't need
 it)... lol
Humidity, an evil and foul word. The humidity factor prevents you from sweating effectively because the humidity factor in the air prevents the process of evaporation. Evaporation of your sweat is critical to transfer of heat from the body. If you just keep sweating without evaporation, the body core temperature will likely increase (and you will continue to ineffectively sweat more). It's a biological feedback system that cannot correct itself as it should. You will dehydrate much sooner in these conditions. The risk of heat exhaustion (dehydration) and even heat stroke (elevated core temperature) are much greater. I've run in this kind of weather, and I can barely get a 1/3 of the distance that I usually do. I hate dry heat... but I loathe humid heat more. Quick consumption of an electrolyte-filled drink is critical here -- Cola just won't do. Later, John
Aug 15 2003
prev sibling next sibling parent reply "Walter" <walter digitalmars.com> writes:
"John Reimer" <jjreimer telus.net> wrote in message
news:bhjm3l$er9$1 digitaldaemon.com...
 A 4 hour ride? Oh, I'd say your body would lap up anything including
 Coke after that!  In fact, Coke probably never tasted so good after such
 a long ride.  I know the feeling (but I'd be craving it at 2.5 hours)
 :).  I must say, after a long hard run (2+ hours), I can't begin to
 describe how wonderful a sugary sweet drink tastes...of any sort.  It's
 a crazy experience.
How far do you run?
Aug 15 2003
parent reply John Reimer <jjreimer telus.net> writes:
Walter wrote:

 "John Reimer" <jjreimer telus.net> wrote in message
 news:bhjm3l$er9$1 digitaldaemon.com...
 
A 4 hour ride? Oh, I'd say your body would lap up anything including
Coke after that!  In fact, Coke probably never tasted so good after such
a long ride.  I know the feeling (but I'd be craving it at 2.5 hours)
:).  I must say, after a long hard run (2+ hours), I can't begin to
describe how wonderful a sugary sweet drink tastes...of any sort.  It's
a crazy experience.
How far do you run?
A little over two hours is my current max without any kind of food or drink intake. I train for half-marathons, hoping to increase that eventually to longer distances (marathon?). My training routes are off road in the hills with some long climbs. I'd say about 14 to 15 miles. I can do much better times on flat routes :). Those are what I call my hard training days. I'm still working on upping my weekly mileage. I'm 6'7" and 225 lbs (not the typical runners build), so I consider it an ahievement if I can survive long runs, but it's all I really want to do. For easy training days, I stick to about 10K runs. 6K if I am really taking it easy. No run, if I'm drop dead lazy ;). Later, John
Aug 15 2003
next sibling parent "Walter" <walter digitalmars.com> writes:
"John Reimer" <jjreimer telus.net> wrote in message
news:bhjsrh$lcu$1 digitaldaemon.com...
 A little over two hours is my current max without any kind of food or
 drink intake.  I train for half-marathons, hoping to increase that
 eventually to longer distances (marathon?).  My training routes are off
 road in the hills with some long climbs. I'd say about 14 to 15 miles.
Pretty brutal!
Aug 15 2003
prev sibling parent "Matthew Wilson" <matthew stlsoft.org> writes:
  I'm
 6'7" and 225 lbs (not the typical runners build),
I feel your pain. I'm 6"1 and 110 kilos (am mixing my metric/imperial, just for laughs), and am not quite in the Richard Armitage league of huge chest and no neck, but am certainly a lot more blockish than the types you'll see climbing mountains in the Pyrenees. Still, you do what you have to do. Anyway, I can sprint pretty damn well on a bike, so as long as we're on the flat it's fine. And as for downhill ... !!! That's one of the reasons I keep trying to persuade me (Australian) wife that we should move to Colorado. I've just got to suss out whether there any good IT companies there, looking for a disarmingly frank C++ guy. Bruce Banner
Aug 15 2003
prev sibling parent "Matthew Wilson" <matthew stlsoft.org> writes:
"John Reimer" <jjreimer telus.net> wrote in message
news:bhjm3l$er9$1 digitaldaemon.com...
 Much truth you say. However, the brain can only metabolyse (for energy
at
 least) carbohydrates, so when exercising hard it is very important for
the
 brain (never mind the muscles) to get carbs.
True, carbs are the only brain fuel. I just wish I could turn it off like a computer so it wouldn't need anything. As an added bonus, I wouldn't feel the pain of steady plodding either. But I guess I still need a brain to run! :)
 The v...ile concoction that is Coca Cola is bad in almost all
situations.
 But as I said, in that one circumstance, after a 4 hour ride, when one
is
 very dehydrated, very low on carbs, and oftentimes headachy, it can
provide
 immediate relief of the headache while you get lots of properly
sustaining
 and replenishing chemicals down your neck.
A 4 hour ride? Oh, I'd say your body would lap up anything including Coke after that! In fact, Coke probably never tasted so good after such a long ride. I know the feeling (but I'd be craving it at 2.5 hours) :). I must say, after a long hard run (2+ hours), I can't begin to describe how wonderful a sugary sweet drink tastes...of any sort. It's a crazy experience.
We are indeed brothers. :) Alas, it's been a long while since I've done a 4-hr one. These days I get about 1hr, 3-5 times a week (plus the odd bit of weights, and yoga once a week.).
Aug 15 2003
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"John Reimer" <jjreimer telus.net> wrote in message
news:bhjd2s$5ob$1 digitaldaemon.com...
 I still have trouble believing the volatile concoction called "Coca
 Cola" can be good for you in any situation.
You're stepping awfully close to heresy.
Aug 15 2003
parent reply John Reimer <jjreimer telus.net> writes:
Walter wrote:

 "John Reimer" <jjreimer telus.net> wrote in message
 news:bhjd2s$5ob$1 digitaldaemon.com...
 
I still have trouble believing the volatile concoction called "Coca
Cola" can be good for you in any situation.
You're stepping awfully close to heresy.
Ohhh No! Uh... would it help to say that I've acted the part of the hypocrite and do very occasionnally have the ambrosia?
Aug 15 2003
next sibling parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"John Reimer" <jjreimer telus.net> wrote in message
news:bhjs8i$ks7$1 digitaldaemon.com...
 Walter wrote:
 "John Reimer" <jjreimer telus.net> wrote in message
 news:bhjd2s$5ob$1 digitaldaemon.com...
I still have trouble believing the volatile concoction called "Coca
Cola" can be good for you in any situation.
You're stepping awfully close to heresy.
Ohhh No! Uh... would it help to say that I've acted the part of the hypocrite and do very occasionnally have the ambrosia?
wimp!say what you mean ... anyway Coca Cola's not volatile, its no good for starting a bar-b-que (to fry the creatures to slow to run away), however it is vile. imho, sugars should only to be consumed once fermented.
Aug 15 2003
parent John Reimer <jjreimer telus.net> writes:
Mike Wynn wrote:


 
 wimp!say what you mean ... anyway Coca Cola's not volatile, its no good for
 starting a bar-b-que (to fry the creatures to slow to run away), however it
 is vile.
 
 imho, sugars should only to be consumed once fermented.
 
 
Wimp? :) yes! no! sometimes! Oh...now I don't know what I mean to say! I don't know about you, but Coca Cola IS volatile in my stomach. But certainly not volatile in the fermented sense of the word. I stay away from that stuff! I'm crazy enough as it is.
Aug 15 2003
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"John Reimer" <jjreimer telus.net> wrote in message
news:bhjs8i$ks7$1 digitaldaemon.com...
 Walter wrote:
 "John Reimer" <jjreimer telus.net> wrote in message
 news:bhjd2s$5ob$1 digitaldaemon.com...
I still have trouble believing the volatile concoction called "Coca
Cola" can be good for you in any situation.
You're stepping awfully close to heresy.
Ohhh No! Uh... would it help to say that I've acted the part of the hypocrite and do very occasionnally have the ambrosia?
Write 6 goto's and 3 self-modifying loops, and you'll be absolved.
Aug 15 2003
parent reply John Reimer <jjreimer telus.net> writes:
 
 
 Write 6 goto's and 3 self-modifying loops, and you'll be absolved.
 
 
LOL That's cruel punishment for heresy. I did goto spaghetti code thing in my BASIC days. I never actually did the self-modifing loops part soI'm only half absolved! I remember getting a big ugly grade on a project in my FORTRAN class because I carried over my BASIC programming skills by creating some really creative spaghetti. I thought it was beautiful and clever... for some reason the instructor didn't share my opinion :). Oh the days of messy programming in BASIC and 6502 assembler! It was soo fun! Later, John
Aug 16 2003
parent reply "Walter" <walter digitalmars.com> writes:
"John Reimer" <jjreimer telus.net> wrote in message
news:bhkn6r$1ne2$1 digitaldaemon.com...
 Write 6 goto's and 3 self-modifying loops, and you'll be absolved.
LOL That's cruel punishment for heresy. I did goto spaghetti code thing in my BASIC days. I never actually did the self-modifing loops part soI'm only half absolved! I remember getting a big ugly grade on a project in my FORTRAN class because I carried over my BASIC programming skills by creating some really creative spaghetti. I thought it was beautiful and clever... for some reason the instructor didn't share my opinion :). Oh the days of messy programming in BASIC and 6502 assembler! It was soo fun!
I've always had a soft spot for self-modifying code. One example I thought was the cat's meow was when I figured out how the original ADVENT FORTRAN program initialized itself, and then rewrote its own executable. I then used a similar technique to avoid configuration files in my own programs. They'd just patch the executable. That came to a halt when virus checking programs became common, as self-modifying exe files were supposedly a sure sign of virus activity. Then Microsoft killed it altogether by making it impossible for an exe to write to itself while running. Oh well. I still enjoy writing x86 assembler.
Aug 16 2003
next sibling parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
It's not impossible.  Just allocate some memory, mark its page callable, and
write some instructions there and call it!  You may have to copy your code
(hope it's internally using relative addressing!)

You may find that you can modify the program code memory to be writable,
allowing old-school SMC.

Personally I wish x86 would go the way of the dinosaur and make room for the
new chip designs.  Trinary ops, anyone?  x86 code requires lots of
superfluous mov's and register management.

Sean

"Walter" <walter digitalmars.com> wrote in message
news:bhkqkp$1va8$1 digitaldaemon.com...
 I've always had a soft spot for self-modifying code. One example I thought
 was the cat's meow was when I figured out how the original ADVENT FORTRAN
 program initialized itself, and then rewrote its own executable.

 I then used a similar technique to avoid configuration files in my own
 programs. They'd just patch the executable. That came to a halt when virus
 checking programs became common, as self-modifying exe files were
supposedly
 a sure sign of virus activity. Then Microsoft killed it altogether by
making
 it impossible for an exe to write to itself while running. Oh well.

 I still enjoy writing x86 assembler.
Aug 16 2003
parent reply "Walter" <walter digitalmars.com> writes:
You're right, but I meant writing to the .exe disk file while running.

"Sean L. Palmer" <palmer.sean verizon.net> wrote in message
news:bhkusi$22oa$1 digitaldaemon.com...
 It's not impossible.  Just allocate some memory, mark its page callable,
and
 write some instructions there and call it!  You may have to copy your code
 (hope it's internally using relative addressing!)

 You may find that you can modify the program code memory to be writable,
 allowing old-school SMC.

 Personally I wish x86 would go the way of the dinosaur and make room for
the
 new chip designs.  Trinary ops, anyone?  x86 code requires lots of
 superfluous mov's and register management.

 Sean

 "Walter" <walter digitalmars.com> wrote in message
 news:bhkqkp$1va8$1 digitaldaemon.com...
 I've always had a soft spot for self-modifying code. One example I
thought
 was the cat's meow was when I figured out how the original ADVENT
FORTRAN
 program initialized itself, and then rewrote its own executable.

 I then used a similar technique to avoid configuration files in my own
 programs. They'd just patch the executable. That came to a halt when
virus
 checking programs became common, as self-modifying exe files were
supposedly
 a sure sign of virus activity. Then Microsoft killed it altogether by
making
 it impossible for an exe to write to itself while running. Oh well.

 I still enjoy writing x86 assembler.
Aug 16 2003
next sibling parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:bhlqec$2qvg$1 digitaldaemon.com...
 You're right, but I meant writing to the .exe disk file while running.
patching you own exe so you can save "state", or both self modifying code and state saveing. not too sure about the effect of self modifying code on x86 cpus with separate I and D caches, but do know that there are very heavy penalties on StrongArm. and there are some hoops you have to jump through on some CPU's to just get the data flushed from D cache into memory and reload the I cache, for example when dynamic compiling. it might be a fun interlectual challenge to see if I can memmap a file, write some self modifying code into it, mark pages as executable and then start running it ... I don't believe that on a modern cpu there are many reasons to want to execute code from stack, or data space, or be able to write to code segment. infact the only reason I think valid is dynamic compilation. and accept that page level granularity (allowing a page to be written, then changed to execute, readonly or execute only) may not be fine enough and there are times when you want to be able to write to a page that is also being excuted, but don't think you should be writing into areas that are actually running especially on a multi proccessor env your going to run a huge risk of shooting yourself, not to mention having the data potentially cached in 4 or more places (2+ cpus with separate I and D caches) and many be even in more than 2 pipelines too. as I only belive writeing code for execution is valid if doing dynamic compilation, there are cpu friendlier ways that only require D-cache flush of a page and I cache invalidation of a page.
Aug 16 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
news:bhls47$2snk$1 digitaldaemon.com...
 I don't believe that on a modern cpu there are many reasons to want to
 execute code from stack, or data space, or be able to write to code
segment. I keep thinking that most buffer overrun exploits would become inoperable if the stack was set to be read/write, but not execute.
Aug 16 2003
parent "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:bhm0j3$9l$1 digitaldaemon.com...
 "Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
 news:bhls47$2snk$1 digitaldaemon.com...
 I don't believe that on a modern cpu there are many reasons to want to
 execute code from stack, or data space, or be able to write to code
segment. I keep thinking that most buffer overrun exploits would become inoperable
if
 the stack was set to be read/write, but not execute.
should do, only leaves you the ability to change the local in current and parent frames and return addresss of parent frames (you might be in a leaf function on a risc arch so current return address may be in link reg) to remove more you have to go further and hide (either change segment reg or mark pages unreadable) the parent frames and return address (separated stacks) still potentially allows you to change locals or scribble into the heap. guess that's the reason ppl rely on software solutions.
Aug 16 2003
prev sibling parent "Sean L. Palmer" <palmer.sean verizon.net> writes:
You mean long-term SMC.  I gotcha.  You could still do that, but in a
roundabout way, by providing a "loader" program that patches the real
program then executes it.  Antivirus software would still complain even if
Windows doesn't.  And there'd still be issues with running multiple copies
of the program simultaneously.

What I would use it for is having a program make special case functions by
splicing together function fragments at runtime.  Or just customizing a
function with special constants before calling it.

Sean

"Walter" <walter digitalmars.com> wrote in message
news:bhlqec$2qvg$1 digitaldaemon.com...
 You're right, but I meant writing to the .exe disk file while running.

 "Sean L. Palmer" <palmer.sean verizon.net> wrote in message
 news:bhkusi$22oa$1 digitaldaemon.com...
 It's not impossible.  Just allocate some memory, mark its page callable,
and
 write some instructions there and call it!  You may have to copy your
code
 (hope it's internally using relative addressing!)
Aug 16 2003
prev sibling parent Bill Cox <bill viasic.com> writes:
 I've always had a soft spot for self-modifying code. One example I thought
 was the cat's meow was when I figured out how the original ADVENT FORTRAN
 program initialized itself, and then rewrote its own executable.
Playing advent (Colasal Caves) was my introduction to computing. The first thing I did after getting 349 points (I never did figure out that magazine thing), was go to the library and read a book on BASIC. The same day, I started hacking... Bill
Aug 19 2003
prev sibling next sibling parent "Walter" <walter digitalmars.com> writes:
"Matthew Wilson" <matthew stlsoft.org> wrote in message
news:bhi0gn$1uf0$3 digitaldaemon.com...
 What we're talking about here is something that is almost always bad, but
 sometimes very good. A better analogy in this case would be a can of Coke.
 Bad in almost all conceivable circumstances,
What are you talking about? Coca-Cola is the Water of Life!
Aug 15 2003
prev sibling parent Derek Parnell <derek.parnell no.spam> writes:
On Fri, 15 Aug 2003 17:07:05 +1000 (08/15/03 17:07:05)
, Matthew Wilson <matthew stlsoft.org> wrote:

 I like goto.
And I like McDonald's BigMacs, but it doesn't mean they're good for me.
Your analogy is not well founded. There are no circumstances under which a Big Mac is appropriate. Even if you do eat meat (though I cannot imagine anyone wishing to do so), then there are better forms of meat. Even if you do need a hamburgler, then there are less mass-produced, healthier, and (from what my carnivorous friends tell me) tastier alternatives. What we're talking about here is something that is almost always bad, but sometimes very good. A better analogy in this case would be a can of Coke. Bad in almost all conceivable circumstances, but if you've got a cycling-<substitute your sport of choice here, so long as it's not golf!>-headache, then the combination of water, high concentration of simple carbohydrates and big shot of caffeine are exactly appropriate. Rehydrates, gives your brain some well needed carbs, and opens up the blood vessels in the old grey matter to assuage the ache until the rehydration kicks in. Marvellous! Derek the Dietician
LOL. I'm so glad you missed my point. The ongoing discussion has been a welcome relief to the sometimes dry D deliberations. I'll try not to be so obtuse this time. BigMacs are bad. I still like them. In other words, just because I like BigMacs, that doesn't make them good. And, just because somebody likes gotos, that doesn't make them good. -- Derek
Aug 17 2003
prev sibling parent reply "Matthew Wilson" <matthew stlsoft.org> writes:
"Frank D. Wills" <fdwills sandarh.com> wrote in message
news:bhh9ic$1853$1 digitaldaemon.com...
 I suppose the goto statement isn't a big issue, but it's the
 first thing I would want to remove from all languages except
 it's equivalent, the jump statement on assembler, where it's
 needed. Otherwise nothing worse or uglier than a goto statement.
Don't mean to offend, but this sounds terribly naive. Just because something is rightly deprecated in most circumstances does not mean it does not have a use. I rarely use it, probably a couple of times a year, but when I do it is the appropriate tool for the job in hand, so I use it.
Aug 15 2003
next sibling parent "Frank D. Wills" <fdwills sandarh.com> writes:
Matthew Wilson wrote:
 "Frank D. Wills" <fdwills sandarh.com> wrote in message
 news:bhh9ic$1853$1 digitaldaemon.com...
 
I suppose the goto statement isn't a big issue, but it's the
first thing I would want to remove from all languages except
it's equivalent, the jump statement on assembler, where it's
needed. Otherwise nothing worse or uglier than a goto statement.
Don't mean to offend, but this sounds terribly naive. Just because something is rightly deprecated in most circumstances does not mean it does not have a use. I rarely use it, probably a couple of times a year, but when I do it is the appropriate tool for the job in hand, so I use it.
Niave? You've got to be kidding!
Aug 15 2003
prev sibling parent reply "Frank D. Wills" <fdwills sandarh.com> writes:
Matthew Wilson wrote:
 "Frank D. Wills" <fdwills sandarh.com> wrote in message
 news:bhh9ic$1853$1 digitaldaemon.com...
 
I suppose the goto statement isn't a big issue, but it's the
first thing I would want to remove from all languages except
it's equivalent, the jump statement on assembler, where it's
needed. Otherwise nothing worse or uglier than a goto statement.
Don't mean to offend, but this sounds terribly naive. Just because something is rightly deprecated in most circumstances does not mean it does not have a use. I rarely use it, probably a couple of times a year, but when I do it is the appropriate tool for the job in hand, so I use it.
The use of a goto statement is a hack, a kludge-fix for a lack of logic and structure. I hope that doesn't sound too terribly naive.
Aug 15 2003
parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
It does.

The goto statement is the direct equivalent of the assembler jmp opcode, the
most fundamental control transfer structure bar none.

Higher-level control constructs should be used when possible.  But goto
exists to allow making of new control constructs (if we had some kind of
macro facility, which we don't) and to get you out of pickles where the nice
"high-level" control constructs don't work and aren't getting the job done.

Believe it or not, C does not provide all the control constructs you'll ever
need, unless you count goto.

Sean

"Frank D. Wills" <fdwills sandarh.com> wrote in message
news:bhilbg$2hmo$1 digitaldaemon.com...
 Matthew Wilson wrote:
 "Frank D. Wills" <fdwills sandarh.com> wrote in message
 news:bhh9ic$1853$1 digitaldaemon.com...

I suppose the goto statement isn't a big issue, but it's the
first thing I would want to remove from all languages except
it's equivalent, the jump statement on assembler, where it's
needed. Otherwise nothing worse or uglier than a goto statement.
Don't mean to offend, but this sounds terribly naive. Just because
something
 is rightly deprecated in most circumstances does not mean it does not
have a
 use. I rarely use it, probably a couple of times a year, but when I do
it is
 the appropriate tool for the job in hand, so I use it.
The use of a goto statement is a hack, a kludge-fix for a lack of logic and structure. I hope that doesn't sound too terribly naive.
Aug 15 2003
parent reply "Frank D. Wills" <fdwills sandarh.com> writes:
Sean,
I don't care if people want to use goto. I don't think
it's the best of choices. Assembler uses the jump statement
because it does not have the facility of higher level
languages, and it is necessary. All branching logic
in higher level languages is implemented as jump statements
in the object code because that is the limit of
available control structures in object/machine code.

Sean L. Palmer wrote:
 It does.
 
 The goto statement is the direct equivalent of the assembler jmp opcode, the
 most fundamental control transfer structure bar none.
 
 Higher-level control constructs should be used when possible.  But goto
 exists to allow making of new control constructs (if we had some kind of
 macro facility, which we don't) and to get you out of pickles where the nice
 "high-level" control constructs don't work and aren't getting the job done.
 
 Believe it or not, C does not provide all the control constructs you'll ever
 need, unless you count goto.
 
 Sean
 
 "Frank D. Wills" <fdwills sandarh.com> wrote in message
 news:bhilbg$2hmo$1 digitaldaemon.com...
 
Matthew Wilson wrote:

"Frank D. Wills" <fdwills sandarh.com> wrote in message
news:bhh9ic$1853$1 digitaldaemon.com...


I suppose the goto statement isn't a big issue, but it's the
first thing I would want to remove from all languages except
it's equivalent, the jump statement on assembler, where it's
needed. Otherwise nothing worse or uglier than a goto statement.
Don't mean to offend, but this sounds terribly naive. Just because
something
is rightly deprecated in most circumstances does not mean it does not
have a
use. I rarely use it, probably a couple of times a year, but when I do
it is
the appropriate tool for the job in hand, so I use it.
The use of a goto statement is a hack, a kludge-fix for a lack of logic and structure. I hope that doesn't sound too terribly naive.
Aug 15 2003
next sibling parent "Matthew Wilson" <matthew stlsoft.org> writes:
 I don't care if people want to use goto. I don't think
 it's the best of choices.
I don't think anyone's saying it is. As I said, I may use it once or twice a year. Given the amount of code I write, this would have to be at most 0.01% of all conditional statements. That hardly represents my best choice, does it? Anyway, if you think that C++, or C, or D, or any other language in which goto is a construct would represent the absolute zenith of language design and implementation if only goto was dropped, then I can't help you, or usefully debate the point further.
Aug 15 2003
prev sibling parent "Sean L. Palmer" <palmer.sean verizon.net> writes:
Yes, there's ways to make it prettier, to make it a little easier to read,
but you really can't beat the flexibility of goto.

Some people like imposing limitations on themselves.  That can be useful, if
artificial, perhaps in a team environment.

Know when to exceed the limitations, and when not to.

This is a holy war in the making.  I'm just going to drop it.

I bet you may not be so against goto if the IDE drew a yellow dotted arrow
from the goto to the label, so you can see the control flow.  ;)

Sean

"Frank D. Wills" <fdwills sandarh.com> wrote in message
news:bhj9tb$2m7$1 digitaldaemon.com...
 Sean,
 I don't care if people want to use goto. I don't think
 it's the best of choices. Assembler uses the jump statement
 because it does not have the facility of higher level
 languages, and it is necessary. All branching logic
 in higher level languages is implemented as jump statements
 in the object code because that is the limit of
 available control structures in object/machine code.

 Sean L. Palmer wrote:
 It does.

 The goto statement is the direct equivalent of the assembler jmp opcode,
the
 most fundamental control transfer structure bar none.

 Higher-level control constructs should be used when possible.  But goto
 exists to allow making of new control constructs (if we had some kind of
 macro facility, which we don't) and to get you out of pickles where the
nice
 "high-level" control constructs don't work and aren't getting the job
done.
 Believe it or not, C does not provide all the control constructs you'll
ever
 need, unless you count goto.

 Sean

 "Frank D. Wills" <fdwills sandarh.com> wrote in message
 news:bhilbg$2hmo$1 digitaldaemon.com...

Matthew Wilson wrote:

"Frank D. Wills" <fdwills sandarh.com> wrote in message
news:bhh9ic$1853$1 digitaldaemon.com...


I suppose the goto statement isn't a big issue, but it's the
first thing I would want to remove from all languages except
it's equivalent, the jump statement on assembler, where it's
needed. Otherwise nothing worse or uglier than a goto statement.
Don't mean to offend, but this sounds terribly naive. Just because
something
is rightly deprecated in most circumstances does not mean it does not
have a
use. I rarely use it, probably a couple of times a year, but when I do
it is
the appropriate tool for the job in hand, so I use it.
The use of a goto statement is a hack, a kludge-fix for a lack of logic and structure. I hope that doesn't sound too terribly naive.
Aug 16 2003
prev sibling parent reply "Matthew Wilson" <matthew stlsoft.org> writes:
 I know, but still, "goto" is part of the language.
Yes, but that neither compels you to use it, or to make it a part of your 'language'.
If it's in, then its use should make sense. (Not that I'm coming down on any side of the goto debate here.)
Aug 14 2003
next sibling parent reply "Frank D. Wills" <fdwills sandarh.com> writes:
Matthew Wilson wrote:
I know, but still, "goto" is part of the language.
Yes, but that neither compels you to use it, or to make it a part of your 'language'.
If it's in, then its use should make sense.
Alcohol and cigaretts are legal. Does that make their use sensible? Teenage pregnacy is legal. Does that also make teenage pregnacy legal? A lack of education beyond highschool is legal. Does that make a lack of further education sensible? Really, what is allowed and what is wise and good are not the same thing, and only the ignorant think otherwise. Oh, by the way, I don't mean to offend by calling you ignorant.
 
 (Not that I'm coming down on any side of the goto debate here.)
 
 
Not coming down on any side of the goto debate? Even when you say that it's "terribly naive" to wishing that modern languages did not implement goto? And that you defend your use of goto as appropriate?
Aug 15 2003
next sibling parent reply Ilya Minkov <midiclub 8ung.at> writes:
Frank D. Wills wrote:
 Matthew Wilson wrote:
 
 I know, but still, "goto" is part of the language.
Yes, but that neither compels you to use it, or to make it a part of your 'language'.
If it's in, then its use should make sense.
 Alcohol and cigaretts are legal. Does that make
 their use sensible? 
I *love* good red wine! So yes. And i don't have anything against people who smoke. Here in Germany I've spent quite some time with girls who do. :)
 Teenage pregnacy is legal. Does
 that also make teenage pregnacy legal?
What's so special about it? Jewish girls may marry from the age of 13 onwards. That means it would quite make sense for them to become pregnant by, say 16.
 A lack of
 education beyond highschool is legal. Does that
 make a lack of further education sensible?
For some poeple yes. Some people just feel better when they do routine jobs, then when they have to think. You *are* naiive!
 Really, what is allowed and what is wise and good
 are not the same thing, and only the ignorant
 think otherwise.
Forbidding stuff will not give us much. Look at Eiffel, and if you still like "forbid-it-all" parctice, go ahead and use it!
 Not coming down on any side of the goto debate? Even when you
 say that it's "terribly naive" to wishing that modern languages
 did not implement goto? And that you defend your use of goto
 as appropriate?
Look at the Linux Kernel. :) There arre plenty of languages which consider themself "safe" and thus firbid it. D has another purpose: it has to be fast and fun and reasonably safe... It has to appeal to both Java and C++ users, and be in 99,9% cases better than these languages. You know: no risk - no fun. :) It is our task to find other fun ways, which lead to less risk. This "go to is harmful" is from the time BASIC ruled (early, non-structured dialects!), and code was so full of GoTos that the style got its name - Spaghetti code. Unreadable. These times, use of GoTo is structured and rare, and does not sacrifice readability of code. If you read any good C++ book or FAQ, you will find an up-to-date list of "no-nos", which is dominated by much more severe problems these days. D strives to be an intuitive solution to them -- and there are still many which D wouldn't solve! Not that i would like D much, but i believe the direction it is heading to is right and good for it, and goto simply belongs to it. -eye/MIDICLUB
Aug 15 2003
parent reply "Frank D. Wills" <fdwills sandarh.com> writes:
Ilya,

You really like to jump in there when there
is conflict, don't you? You enjoy fanning
the flames because you like to see conflict,
fighting, and discord. I've known people like
you. You like to see things and people torn
by discord and destruction. This is just what
I hope does not happen to this newsgroup and
project.

Considering all that Walter has put into this
effort, I do not think that it is a fitting
response to turn this group into a bunch of
bickering children.

I think calling me names, and degenerating
into personal attacks on me, just because I
express an opinion about an aspect common to
many languages is just the kind of thing that
will destroy the good spirit that has been
enjoyed in this newsgroup.

And again, I think it is a very poor thank-you
to Walter to cause the degeneration of this
newsgroup. As Walter said, it is the enthusiasm
of everyone for the work he is doing that
keeps him going. Maybe Walter didn't know
his supporters were just childern, prone to
bickering, fighting, and a lack of disipline.

I don't think we deserve what Walter is doing,
but he is doing it, and sharing it with us,
and I think we should do our best to not
destroy the good spirit that is behind what
Walter is doing.

Ilya Minkov wrote:
 Frank D. Wills wrote:
 
 Matthew Wilson wrote:
 If it's in, then its use should make sense.
 A lack of
 education beyond highschool is legal. Does that
 make a lack of further education sensible?
For some poeple yes. Some people just feel better when they do routine jobs, then when they have to think. You *are* naiive!
Aug 15 2003
next sibling parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
 Considering all that Walter has put into this
 effort, I do not think that it is a fitting
 response to turn this group into a bunch of
 bickering children.
well said, and to misquote and paraphrase Walter, this is a programming language not a religion so lets have a nice clean fight and argue about the point (goto) can we get to it without going to it ? I'll break from here and let you continue .... (or was the redo which you can't do!) not meaning to throw an exception into the works.
Aug 15 2003
next sibling parent "Frank D. Wills" <fdwills sandarh.com> writes:
Mike Wynn wrote:
Considering all that Walter has put into this
effort, I do not think that it is a fitting
response to turn this group into a bunch of
bickering children.
well said, and to misquote and paraphrase Walter, this is a programming language not a religion so lets have a nice clean fight and argue about the point (goto) can we get to it without going to it ? I'll break from here and let you continue .... (or was the redo which you can't do!) not meaning to throw an exception into the works.
Amen! (Opps! Switching to non-religeous mode...) Great!
Aug 15 2003
prev sibling parent "Walter" <walter digitalmars.com> writes:
"Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
news:bhjc5n$4o5$1 digitaldaemon.com...
 so lets have a nice clean fight and argue about the point (goto)
 can we get to it without going to it ?
Long ago, when I started at a new company, a senior programmer did a grep across all my code for 'goto', and printed out the matching lines. He then passed this around at the weekly meeting and used it as justification for my code being of poor quality. I asked him if he'd looked at the context of each of those goto's to see if they were justifiable or not. He had not, and backed down. Ironically, we became great friends and worked together on a lot of successful projects. I think he liked having someone stand him down in a meeting <g>.
Aug 15 2003
prev sibling next sibling parent reply Benji Smith <dlanguage xxagg.com> writes:
In article <bhjbbb$420$1 digitaldaemon.com>, Frank D. Wills says...
Considering all that Walter has put into this
effort, I do not think that it is a fitting
response to turn this group into a bunch of
bickering children.
I'm a little incredulous that we could get so worked up over an issue so mundane as gotos. If everyone is going to get into a big huff and bickering, it should be about templates or runtime object reflection or stack unwinding or soemthing else important. --Benji Smith
Aug 15 2003
parent reply Patrick Down <Patrick_member pathlink.com> writes:
In article <bhjdpv$6gk$1 digitaldaemon.com>, Benji Smith says...
In article <bhjbbb$420$1 digitaldaemon.com>, Frank D. Wills says...
Considering all that Walter has put into this
effort, I do not think that it is a fitting
response to turn this group into a bunch of
bickering children.
I'm a little incredulous that we could get so worked up over an issue so mundane as gotos. If everyone is going to get into a big huff and bickering, it should be about templates or runtime object reflection or stack unwinding or soemthing else important. --Benji Smith
Oh, it's one of the topics best to avoid. Religion, politics, and gotos. <g>
Aug 15 2003
next sibling parent "Charles Sanders" <sanders-consulting comcast.net> writes:
lol!
"Patrick Down" <Patrick_member pathlink.com> wrote in message
news:bhjenm$7hh$1 digitaldaemon.com...
 In article <bhjdpv$6gk$1 digitaldaemon.com>, Benji Smith says...
In article <bhjbbb$420$1 digitaldaemon.com>, Frank D. Wills says...
Considering all that Walter has put into this
effort, I do not think that it is a fitting
response to turn this group into a bunch of
bickering children.
I'm a little incredulous that we could get so worked up over an issue so
mundane
as gotos. If everyone is going to get into a big huff and bickering, it
should
be about templates or runtime object reflection or stack unwinding or
soemthing
else important.

--Benji Smith
Oh, it's one of the topics best to avoid. Religion, politics, and gotos.
<g>

Aug 15 2003
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"Patrick Down" <Patrick_member pathlink.com> wrote in message
news:bhjenm$7hh$1 digitaldaemon.com...
 Oh, it's one of the topics best to avoid.  Religion, politics, and gotos.
<g> Reminds me of another story <g>. Another colleague of mine, long ago, was a pascal zealot. We were a C shop, and he never lost an opportunity to point out how Pascal was better. One day, a person came to the office and asked to see him. Our office was one large cavernous bay divided into cubicles. I said in a loud voice "Pascal sucks!". Up he popped "who said that?" I spoke to the visitor: "he's right over there." He got teased about that one for years <g>.
Aug 15 2003
parent "Charles Sanders" <sanders-consulting comcast.net> writes:
lol!

"Walter" <walter digitalmars.com> wrote in message
news:bhjtte$m5b$1 digitaldaemon.com...
 "Patrick Down" <Patrick_member pathlink.com> wrote in message
 news:bhjenm$7hh$1 digitaldaemon.com...
 Oh, it's one of the topics best to avoid.  Religion, politics, and
gotos.
 <g>

 Reminds me of another story <g>. Another colleague of mine, long ago, was
a
 pascal zealot. We were a C shop, and he never lost an opportunity to point
 out how Pascal was better. One day, a person came to the office and asked
to
 see him. Our office was one large cavernous bay divided into cubicles. I
 said in a loud voice "Pascal sucks!". Up he popped "who said that?" I
spoke
 to the visitor: "he's right over there."

 He got teased about that one for years <g>.
Aug 17 2003
prev sibling next sibling parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
I'm personally surprised for this comment. I've been around this newsgroup
for over a year now and I had never seen such a reply. Actually, I remember
someone some time ago saying something about this, that this was a really
polite newsgroup. And I can also remember Walter saying something in a c++
forum about digitalmars newsgroups being visited by individuals who usually
good-behave.

I'm not trying to blame you, Frank, I'm just expressing myself. And now that
I'm there (and since lately we all tend to go a bit OT), we must remember
that we all are persons with emotions and everything else that comes with
our human condition (sorry, didn't find another way to express that) and
there're moments when we only want to let our feelings go. I, myself, a
couple of months ago wrote this really weird post worrying about my
professional future (and a couple of persons here gave me good advice) but
only because I was a bit depressed. I'm just trying to find an explanation
for what Ilya said, because, for what I've read from him, he's not usually
like that. Or I might be wrong, who knows.

Like Benji said, getting so bitter about goto isn't a good thing to do. Like
Mike said, if there's to be an argument, go to (no pun intended) the point.
And finally, programming isn't *that* important to get so expressive.
Tomorrow starts world war 3 and in a week everything is destroyed. The last
we'll be thinking is programming, so save your anger for better moments.

(all that, IMHO)

-------------------------
Carlos Santander

"Frank D. Wills" <fdwills sandarh.com> wrote in message
news:bhjbbb$420$1 digitaldaemon.com...
| Ilya,
|
| You really like to jump in there when there
| is conflict, don't you? You enjoy fanning
| the flames because you like to see conflict,
| fighting, and discord. I've known people like
| you. You like to see things and people torn
| by discord and destruction. This is just what
| I hope does not happen to this newsgroup and
| project.
|
| Considering all that Walter has put into this
| effort, I do not think that it is a fitting
| response to turn this group into a bunch of
| bickering children.
|
| I think calling me names, and degenerating
| into personal attacks on me, just because I
| express an opinion about an aspect common to
| many languages is just the kind of thing that
| will destroy the good spirit that has been
| enjoyed in this newsgroup.
|
| And again, I think it is a very poor thank-you
| to Walter to cause the degeneration of this
| newsgroup. As Walter said, it is the enthusiasm
| of everyone for the work he is doing that
| keeps him going. Maybe Walter didn't know
| his supporters were just childern, prone to
| bickering, fighting, and a lack of disipline.
|
| I don't think we deserve what Walter is doing,
| but he is doing it, and sharing it with us,
| and I think we should do our best to not
| destroy the good spirit that is behind what
| Walter is doing.
|


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.510 / Virus Database: 307 - Release Date: 2003-08-14
Aug 15 2003
parent reply "Frank D. Wills" <fdwills sandarh.com> writes:
Carlos Santander B. wrote:
 I'm personally surprised for this comment. I've been around this newsgroup
 for over a year now and I had never seen such a reply. Actually, I remember
 someone some time ago saying something about this, that this was a really
 polite newsgroup. And I can also remember Walter saying something in a c++
 forum about digitalmars newsgroups being visited by individuals who usually
 good-behave.
That's true. It's good, and unique, and needs to be kept that way.
 
 I'm not trying to blame you, Frank, I'm just expressing myself. And now that
 I'm there (and since lately we all tend to go a bit OT), we must remember
 that we all are persons with emotions and everything else that comes with
 our human condition (sorry, didn't find another way to express that) and
 there're moments when we only want to let our feelings go. I, myself, a
 couple of months ago wrote this really weird post worrying about my
 professional future (and a couple of persons here gave me good advice) but
 only because I was a bit depressed. I'm just trying to find an explanation
 for what Ilya said, because, for what I've read from him, he's not usually
 like that. Or I might be wrong, who knows.
Carlos, I appreciate what you say, and it is good to be as understanding of others as possible. I certainly wish others well, but not all people do well or choose good. In the past I have tried to placate trouble makers, and befriend them. I wish I could say that it worked, but it only seemed to encourage them. As an example, I once knew a person who disrupted an entire computer science department for over one year, maybe two (it's been so long I don't remember.) I think eventually all of us were trying to encourage something good in this person. I the meantime he made a lot of things bad for a lot of people. Eventually this person, as was his way, got into a heated shouting match with the chairman of the computer science department. The argument spilled out of the chairman's office into the hallway, and became very physical. The trouble maker put the chairman into the hospital, having beaten him and caused many bone fractures. This person had no remorse for what he did. In fact, he was giddy with glee. The chairman left the department, worse for the wear. Eventually everyone stopped befriending this person, because nothing seemed to encourage him to enjoy anything but trouble. For myself, until things became like this I had liked this person fairly well. There seem to be people who enjoy and encourage trouble. It's not something I understand. In the end, I think each of us chooses how we respond to things, and the choices we make, and we get a glimpse of the good or the harm that will come with that choice. Some people, for some reason, just don't choose the thing that will make things better or good. What Walter is doing is very important to me, and I imagine, to some, perhaps many others. I have waited years for someone to do this, and it could end up being far more than we might hope at this point, but many things are possible, both good and bad, and what this becomes will be as small or as great, as good or as bad, as we choose to make it.
 
 Like Benji said, getting so bitter about goto isn't a good thing to do. Like
 Mike said, if there's to be an argument, go to (no pun intended) the point.
 And finally, programming isn't *that* important to get so expressive.
 Tomorrow starts world war 3 and in a week everything is destroyed. The last
 we'll be thinking is programming, so save your anger for better moments.
 
I am just very concerned that this newsgroup is going to decend into the common ground of so many other groups that end up fighting and bickering, and I'm saying that fighting and bickering, and personal attacks are very destructive, and that once people start flaming each other, the bad feelings grow, and it is hard to put an end to the bad things that grow, and the good things that are missed, and turn things back around into something good. In this case it would be a very bad thing for that to happen. For instance, what if all the Unix people had worked together, rather than fragmenting. What good could have come from that? There is no guarantee, _ever_ that things will become anything but what we make them. There is a lot of good and opportunity for us all here, and it will all be for the greater than imagined good _if_ we encourage each other, and bring out the best in each other, and make the best things happen. I especially think of that in the context of what Walter has given this group, and what he has dedicated himself to continue doing. And especially in the good, careful, and giving manner in which he is doing everything for this group and this project. Perhaps things that _any_ of us might do to _fail_ to be thankful and well-mannered in response to, with all of this good, which we are so incredibly fortunate, out of all the world, and in all of history, does bother me a bit. How many of us realize how lucky we are to be a part of this? Most of the billions of the people of people in the world, and in all of our history, could never even dream of being a part of something like this. And I will also add, that the creation of a language like D is a very significant thing, something along the lines of the creation of Unix and C. Right now, powerful corporations control the most used and most powerful languages. With that power comes control of our future as programmers and software developers. In that sence there is a fight, a struggle going on for this control. Those who control the operating systems, languages, and software of the future will control a fundamental, foundational aspect of out lives and our future. Who controls the future: which people, which corporations? It's all being determined now. How do we treat, and treasure, this opportunity?
 (all that, IMHO)
 
 -------------------------
 Carlos Santander
 
 "Frank D. Wills" <fdwills sandarh.com> wrote in message
 news:bhjbbb$420$1 digitaldaemon.com...
 | Ilya,
 |
 | You really like to jump in there when there
 | is conflict, don't you? You enjoy fanning
 | the flames because you like to see conflict,
 | fighting, and discord. I've known people like
 | you. You like to see things and people torn
 | by discord and destruction. This is just what
 | I hope does not happen to this newsgroup and
 | project.
 |
 | Considering all that Walter has put into this
 | effort, I do not think that it is a fitting
 | response to turn this group into a bunch of
 | bickering children.
 |
 | I think calling me names, and degenerating
 | into personal attacks on me, just because I
 | express an opinion about an aspect common to
 | many languages is just the kind of thing that
 | will destroy the good spirit that has been
 | enjoyed in this newsgroup.
 |
 | And again, I think it is a very poor thank-you
 | to Walter to cause the degeneration of this
 | newsgroup. As Walter said, it is the enthusiasm
 | of everyone for the work he is doing that
 | keeps him going. Maybe Walter didn't know
 | his supporters were just childern, prone to
 | bickering, fighting, and a lack of disipline.
 |
 | I don't think we deserve what Walter is doing,
 | but he is doing it, and sharing it with us,
 | and I think we should do our best to not
 | destroy the good spirit that is behind what
 | Walter is doing.
 |
 
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.510 / Virus Database: 307 - Release Date: 2003-08-14
 
 
Aug 15 2003
parent "Sean L. Palmer" <palmer.sean verizon.net> writes:
"Why can't we all just get along in peace and harmony?"

Well, we were, before you came and started telling people how insensitive
they are.

I don't understand you.  What do you hope to gain by ranting this way?

Good luck getting rid of us all.  If you succeed, you may well destroy D in
the process.  We are its users.  Be thankful.

Sean

"Frank D. Wills" <fdwills sandarh.com> wrote in message
news:bhjndo$g0v$1 digitaldaemon.com...
 I appreciate what you say, and it is good to be as
 understanding of others as possible. I certainly wish
 others well, but not all people do well or choose good.

 In the past I have tried to placate trouble makers, and
 befriend them. I wish I could say that it worked, but it
 only seemed to encourage them. As an example, I once knew
 a person who disrupted an entire computer science department
 for over one year, maybe two (it's been so long I don't
 remember.) I think eventually all of us were trying to
 encourage something good in this person. I the meantime
 he made a lot of things bad for a lot of people. Eventually
 this person, as was his way, got into a heated shouting
 match with the chairman of the computer science department.
 The argument spilled out of the chairman's office into the
 hallway, and became very physical. The trouble maker put the
 chairman into the hospital, having beaten him and caused
 many bone fractures. This person had no remorse for what
 he did. In fact, he was giddy with glee. The chairman
 left the department, worse for the wear. Eventually everyone
 stopped befriending this person, because nothing seemed
 to encourage him to enjoy anything but trouble. For myself,
 until things became like this I had liked this person
 fairly well.

 There seem to be people who enjoy and encourage trouble. It's
 not something I understand. In the end, I think each of us
 chooses how we respond to things, and the choices we make,
 and we get a glimpse of the good or the harm that will come
 with that choice. Some people, for some reason, just don't
 choose the thing that will make things better or good.

 What Walter is doing is very important to me, and I imagine,
 to some, perhaps many others. I have waited years for someone
 to do this, and it could end up being far more than we might
 hope at this point, but many things are possible, both good
 and bad, and what this becomes will be as small or as great,
 as good or as bad, as we choose to make it.

 Like Benji said, getting so bitter about goto isn't a good thing to do.
Like
 Mike said, if there's to be an argument, go to (no pun intended) the
point.
 And finally, programming isn't *that* important to get so expressive.
 Tomorrow starts world war 3 and in a week everything is destroyed. The
last
 we'll be thinking is programming, so save your anger for better moments.
I am just very concerned that this newsgroup is going to decend into the common ground of so many other groups that end up fighting and bickering, and I'm saying that fighting and bickering, and personal attacks are very destructive, and that once people start flaming each other, the bad feelings grow, and it is hard to put an end to the bad things that grow, and the good things that are missed, and turn things back around into something good. In this case it would be a very bad thing for that to happen. For instance, what if all the Unix people had worked together, rather than fragmenting. What good could have come from that? There is no guarantee, _ever_ that things will become anything but what we make them. There is a lot of good and opportunity for us all here, and it will all be for the greater than imagined good _if_ we encourage each other, and bring out the best in each other, and make the best things happen. I especially think of that in the context of what Walter has given this group, and what he has dedicated himself to continue doing. And especially in the good, careful, and giving manner in which he is doing everything for this group and this project. Perhaps things that _any_ of us might do to _fail_ to be thankful and well-mannered in response to, with all of this good, which we are so incredibly fortunate, out of all the world, and in all of history, does bother me a bit. How many of us realize how lucky we are to be a part of this? Most of the billions of the people of people in the world, and in all of our history, could never even dream of being a part of something like this. And I will also add, that the creation of a language like D is a very significant thing, something along the lines of the creation of Unix and C. Right now, powerful corporations control the most used and most powerful languages. With that power comes control of our future as programmers and software developers. In that sence there is a fight, a struggle going on for this control. Those who control the operating systems, languages, and software of the future will control a fundamental, foundational aspect of out lives and our future. Who controls the future: which people, which corporations? It's all being determined now. How do we treat, and treasure, this opportunity?
Aug 16 2003
prev sibling parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
Make a more convincing argument next time, grounded in real logic and not
bad analogy, and learn how to deal with real people in the meantime.

Listen to yourself.  You are making too big a deal over this.   Goto holy
wars are not the place to be if you can't take a flame or three.

We all know Walter busts his ass on this language.  But what has this to do
with him, really?  He's probably laughing his ass off, or ignoring the whole
thread.  ;)

Sean

"Frank D. Wills" <fdwills sandarh.com> wrote in message
news:bhjbbb$420$1 digitaldaemon.com...
 Ilya,

 You really like to jump in there when there
 is conflict, don't you? You enjoy fanning
 the flames because you like to see conflict,
 fighting, and discord. I've known people like
 you. You like to see things and people torn
 by discord and destruction. This is just what
 I hope does not happen to this newsgroup and
 project.

 Considering all that Walter has put into this
 effort, I do not think that it is a fitting
 response to turn this group into a bunch of
 bickering children.

 I think calling me names, and degenerating
 into personal attacks on me, just because I
 express an opinion about an aspect common to
 many languages is just the kind of thing that
 will destroy the good spirit that has been
 enjoyed in this newsgroup.

 And again, I think it is a very poor thank-you
 to Walter to cause the degeneration of this
 newsgroup. As Walter said, it is the enthusiasm
 of everyone for the work he is doing that
 keeps him going. Maybe Walter didn't know
 his supporters were just childern, prone to
 bickering, fighting, and a lack of disipline.

 I don't think we deserve what Walter is doing,
 but he is doing it, and sharing it with us,
 and I think we should do our best to not
 destroy the good spirit that is behind what
 Walter is doing.

 Ilya Minkov wrote:
 Frank D. Wills wrote:

 Matthew Wilson wrote:
 If it's in, then its use should make sense.
 A lack of
 education beyond highschool is legal. Does that
 make a lack of further education sensible?
For some poeple yes. Some people just feel better when they do routine jobs, then when they have to think. You *are* naiive!
Aug 16 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Sean L. Palmer" <palmer.sean verizon.net> wrote in message
news:bhktil$21kb$1 digitaldaemon.com...
 We all know Walter busts his ass on this language.  But what has this to
do
 with him, really?  He's probably laughing his ass off, or ignoring the
whole
 thread.  ;)
I'm reading it. The thing is, the goto debate was raging in the 1970's. I've got the scars and the t-shirt to prove it. The issue was never resolved (and cannot be), it just settled into a truce where those who liked goto's used them and those who didn't didn't. Language designers who wished to appeal to both groups put in a goto.
Aug 16 2003
parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:bhlr17$2rhj$1 digitaldaemon.com...
 "Sean L. Palmer" <palmer.sean verizon.net> wrote in message
 news:bhktil$21kb$1 digitaldaemon.com...
 We all know Walter busts his ass on this language.  But what has this to
do
 with him, really?  He's probably laughing his ass off, or ignoring the
whole
 thread.  ;)
I'm reading it. The thing is, the goto debate was raging in the 1970's.
I've
 got the scars and the t-shirt to prove it. The issue was never resolved
(and
 cannot be), it just settled into a truce where those who liked goto's used
 them and those who didn't didn't. Language designers who wished to appeal
to
 both groups put in a goto.
I agree it never will be resolved, however believe as more languages add features that replace most of the uses of goto and less implement it, the users (and uses) of goto will slowly fade into obscurity. D offers more that many langs for removing goto without seriour effect to code (multi level break/continue, exception and nested functions) so far I've only heard one good reason for having goto in D (back end support) which I accept does make life easier those who are going to use D as a backend lang. I'm curious if there are any others that can not be resolved easily (multi level redo is the only other thing that comes to mind, something I have wanted to do on the odd occasion)
Aug 16 2003
parent "Walter" <walter digitalmars.com> writes:
"Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
news:bhm0mh$ev$1 digitaldaemon.com...
 I'm curious if there are any others that can not be resolved easily
 (multi level redo is the only other thing that comes to mind, something I
 have wanted to do on the odd occasion)
Jumping forward into a loop. <g>
Aug 16 2003
prev sibling next sibling parent "Matthew Wilson" <matthew stlsoft.org> writes:
"Frank D. Wills" <fdwills sandarh.com> wrote in message
news:bhiq1s$2m35$1 digitaldaemon.com...
 Matthew Wilson wrote:
I know, but still, "goto" is part of the language.
Yes, but that neither compels you to use it, or to make it a part of
your
'language'.
If it's in, then its use should make sense.
Alcohol and cigaretts are legal. Does that make their use sensible? Teenage pregnacy is legal. Does that also make teenage pregnacy legal? A lack of education beyond highschool is legal. Does that make a lack of further education sensible? Really, what is allowed and what is wise and good are not the same thing, and only the ignorant think otherwise. Oh, by the way, I don't mean to offend by calling you ignorant.
How can I be offended, when you've extrapolated what I said beyond reason, sense, or indeed comprehension. You should go into politics
 (Not that I'm coming down on any side of the goto debate here.)
Not coming down on any side of the goto debate? Even when you say that it's "terribly naive" to wishing that modern languages did not implement goto? And that you defend your use of goto as appropriate?
That was in another thread. In the post we're referencing I simply said that if something is in the language, then it should make sense.
Aug 15 2003
prev sibling parent "Matthew Wilson" <matthew stlsoft.org> writes:
  Teenage pregnacy is legal. Does
 that also make teenage pregnacy legal?
I presume you mistyped and meant to say "also make teenage pregnacy sensible?" It depends on your point of view. From a physical perspective it's probably the case that late-teen/early-20s pregnancy (and birth - I presume we're not talking about the sense of pregnancy+termination as a birth control, which indeed seems to make no sense to me) is probably the ideal. The fact that our (by which I mean western) society deems it inappropriate is more a manifestation of our so-called morals (career, materialism, diminshing importance of the wider family group, etc.) than an absolute moral question, so I think you'd have to qualify your statement. In so far as it relates to the goto question, though, you appear to have picked the perfect analogy. In most conceivable cases, teenage pregnancy is to be avoided, and in many many instances would be harmful. However, to say that it is wrong in _all_ cases is tantamount to saying that you have omniscience, which I presume you do not. For the religious, this would mean you are (G/g)od, which I further presume you are not.
Aug 15 2003
prev sibling parent reply Benji Smith <dlanguage xxagg.com> writes:
On Fri, 15 Aug 2003 16:59:33 +1000, "Matthew Wilson"
<matthew stlsoft.org> wrote:

If it's in, then its use should make sense.
I agree. goto should either be taken out of the language or it should be able to accept an empty statement (without the kludges of requiring a semicolon or a zero). Personally, I think it should stay, but I wouldn't be too disappointed if there was no goto. --Benji Smith
Aug 15 2003
parent reply Ilya Minkov <midiclub 8ung.at> writes:
Benji Smith wrote:

 I agree. goto should either be taken out of the language or it should
 be able to accept an empty statement (without the kludges of requiring
 a semicolon or a zero).
WAIT A MOMENT! What do you think an empty statement looks like? Either {} or ; but } is not an empty statement From the parsing point of view, label would need to be a stetement all by itself, i don't know whether this imposes any problem. Or } should be interpreted as ;} which should work OK. I just can't understand what's wrong about: ... jump_out: ; } -eye/MIDICLUB
Aug 15 2003
next sibling parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
"Ilya Minkov" <midiclub 8ung.at> wrote in message
news:bhj2s5$2tmc$1 digitaldaemon.com...
 Benji Smith wrote:

 I agree. goto should either be taken out of the language or it should
 be able to accept an empty statement (without the kludges of requiring
 a semicolon or a zero).
WAIT A MOMENT! What do you think an empty statement looks like? Either {} or ; but } is not an empty statement
An empty statement could be completely empty if control constructs always controlled blocks instead of statements. ;)
  From the parsing point of view, label would need to be a stetement all
 by itself, i don't know whether this imposes any problem. Or } should be
 interpreted as ;} which should work OK.
Yeah, you have the solution: label is a form of statement, that generates no code, just a place marker.
 I just can't understand what's wrong about:
 ...
 jump_out: ;
 }
It sucks. Too easy to forget the ';' -- and what is the purpose? To annoy the programmer? Sean
Aug 15 2003
parent reply Ilya Minkov <midiclub 8ung.at> writes:
Sean L. Palmer wrote:

 Yeah, you have the solution:  label is a form of statement, that generates
 no code, just a place marker.
This may impose a problem with labelled loops? -eye
Aug 15 2003
parent "Sean L. Palmer" <palmer.sean verizon.net> writes:
So it's a statement that attaches itself to the next statement.

What exactly is the problem you see?

Sean

"Ilya Minkov" <midiclub 8ung.at> wrote in message
news:bhj56v$2ve6$1 digitaldaemon.com...
 Sean L. Palmer wrote:

 Yeah, you have the solution:  label is a form of statement, that
generates
 no code, just a place marker.
This may impose a problem with labelled loops? -eye
Aug 16 2003
prev sibling parent "Philippe Mori" <philippe_mori hotmail.com> writes:
IMO, empty statement should not be allowed at all. We should uses a
statement that has no effect or have a keyword "nop". That changes would
also prevent bug like:

while (somecondition);
    do_something();

where there is an extra semicolon at the end of the first line...

And the keyword would also be usable in for loop (1st and 3rd expression).
The 2nd one should always be a condition (and we can uses true if we
do not want it), For example:

for (nop, true, nop)
{
}

In you case, you will have:

...
jump_out:
    nop;
}

This makes the code a bit clearer and less error prone...


IMO, I think that for switch statement, we should have no_break keyword when
we want to fall-through.

break would be required except when one of these rules is verified:

- there is a break, a return, a throw, a no_break or a goto at the end of
the case.
- the case is empty (a group of similar cases). But in that case, maybe it
would be
better to be able to enumerate them (as in Pascal) and then we would never
need empty statement and we would not even allow them anywhere.


"Ilya Minkov" <midiclub 8ung.at> a écrit dans le message de
news:bhj2s5$2tmc$1 digitaldaemon.com...
 Benji Smith wrote:

 I agree. goto should either be taken out of the language or it should
 be able to accept an empty statement (without the kludges of requiring
 a semicolon or a zero).
WAIT A MOMENT! What do you think an empty statement looks like? Either {} or ; but } is not an empty statement From the parsing point of view, label would need to be a stetement all by itself, i don't know whether this imposes any problem. Or } should be interpreted as ;} which should work OK. I just can't understand what's wrong about: ... jump_out: ; } -eye/MIDICLUB
Aug 15 2003
prev sibling next sibling parent reply "Walter" <walter digitalmars.com> writes:
"Martin M. Pedersen" <martin moeller-pedersen.dk> wrote in message
news:bhgh13$flp$1 digitaldaemon.com...
 "Charles Sanders" <sanders-consulting comcast.net> wrote in message
 news:bhgdqv$cfh$1 digitaldaemon.com...
 It would be more elegenat if you didnt use goto's :P.
I know, but still, "goto" is part of the language.
Goto's are like pointers. You rarely need them, but when you do, they're real nice to have!
Aug 15 2003
next sibling parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:bhjp67$htd$1 digitaldaemon.com...
 "Martin M. Pedersen" <martin moeller-pedersen.dk> wrote in message
 news:bhgh13$flp$1 digitaldaemon.com...
 "Charles Sanders" <sanders-consulting comcast.net> wrote in message
 news:bhgdqv$cfh$1 digitaldaemon.com...
 It would be more elegenat if you didnt use goto's :P.
I know, but still, "goto" is part of the language.
Goto's are like pointers. You rarely need them, but when you do, they're real nice to have!
but like pointers there are other constructs that are more robust and perform the same task (bounded array and reference (unmovable pointer)) even at a very low level, you only _need_ those two (well bounded array is enough as a length of one is a ref, but we all like a little syntactic sugar). movable pointer is just an efficient way to do both in one go. (well unbounded array) we've not even dared to mention the double evil "setjump/longjump" which use incorrectly allows you to go the wrong way along an already used stack. I am yet to find a use of goto that can not be solved by either multi-level break/continue or by changing a block of code into an inline function, which in D is equiv to using a nested function, and in most cases actually makes the code more readable. surely as a compiler writer, the simple fact that a goto can branch into a loop mush be reason enough to consider removing it, thus allowing the compiler to be able to do loop invariant detection without the worry that someone is going to "goto" the middle of a loop where 50% of the state has been moved outside it ? I'll quote your own docs ... "D aims to reduce software development costs by at least 10% by adding in proven productivity enhancing features and by adjusting language features so that common, time-consuming bugs are eliminated from the start." isn't goto one of the causes of unexpected programming errors due to the way it allows you to "break the flow" of a program. and don't the majority of ppl who are in the first 4 groups of ppl in the "who is d for" section want to see and end to goto? I believe (wrongly maybe) that the easier a human can understand a section of code, the greater the chances that a compiler can optimise it do do what I want, in the best way. and goto and setjump/longjump are not (in my mind) compiler friendly flow control. Exceptions and labled blocks are much better, (I would like to see a redo statement (that's continue without the check on an entry condition loop))
Aug 15 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
news:bhjruo$kd9$1 digitaldaemon.com...
 but like pointers there are other constructs that are more robust and
 perform the same task
 (bounded array and reference (unmovable pointer))
 even at a very low level, you only _need_ those two (well bounded array is
 enough as a length of one is a ref, but we all like a little syntactic
 sugar).
 movable pointer is just an efficient way to do both in one go. (well
 unbounded array)
You can always refactor the code to eliminate the need for a goto. That doesn't mean it's cost effective, especially when it results in a lot of diff's from one version to the next that makes it hard to verify just how the algorithm changed.
 we've not even dared to mention the double evil "setjump/longjump" which
use
 incorrectly allows you to go the wrong way along an already used stack.
Exception handling effectively replaces that.
 surely as a compiler writer, the simple fact that a goto can branch into a
 loop mush be reason enough to consider removing it, thus allowing the
 compiler to be able to do loop invariant detection without the worry that
 someone is going to "goto" the middle of a loop where 50% of the state has
 been moved outside it ?
What you're describing is called an "irreducible flow graph". However, the optimization algorithms I use work just as well regardless of whether the flow graph is reducible or not.
 I'll quote your own docs ...
 "D aims to reduce software development costs by at least 10% by adding in
 proven productivity enhancing features and by adjusting language features
so
 that common, time-consuming bugs are eliminated from the start."
 isn't goto one of the causes of unexpected programming errors due to the
way
 it allows you to "break the flow" of a program.
D allows an escape from every constraint it imposes. How D lives up to the rule you quoted is by not *requiring* one to use error-prone constructs to accomplish the vast majority of programming tasks.
Aug 15 2003
parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:bhkbde$1cgb$1 digitaldaemon.com...
 "Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
 news:bhjruo$kd9$1 digitaldaemon.com...
 but like pointers there are other constructs that are more robust and
 perform the same task
 (bounded array and reference (unmovable pointer))
 even at a very low level, you only _need_ those two (well bounded array
is
 enough as a length of one is a ref, but we all like a little syntactic
 sugar).
 movable pointer is just an efficient way to do both in one go. (well
 unbounded array)
You can always refactor the code to eliminate the need for a goto. That doesn't mean it's cost effective, especially when it results in a lot of diff's from one version to the next that makes it hard to verify just how the algorithm changed.
therefore a language without a goto can be used as a backend language, meaning that the D compiler writer has an easier task, and the user of D as a backend has a more complex task. as I said, I would prefer to see D as a front end using a backend that was designed for the task of being a backend. I'm sure it would horrify you that I would also like to see the system taken to what to me seem a logical conclusion of having D+ (superset of D syntax with goto and other "unsafe features") D (the core D with a few "unsafe" ops but not too many) sliceing stack alloced arrays, or passing inner functions as delegates (or has safe ways to allow this (stack frame promoted to heap etc))) all using the same backend, which may also support functional, and dynamic langs allowing the D langs to interoperate even better than it can now. (potential to link to C++ or other OO langs directly [rather than using C as an intermediate convention])
Aug 16 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
news:bhm1ga$1e4$1 digitaldaemon.com...
 I'm sure it would horrify you that I would also like to see the system
taken
 to what to me seem a logical conclusion of having
 D+ (superset of D syntax with goto and other "unsafe features")
 D  (the core D with a few "unsafe" ops but not too many)

 sliceing stack alloced arrays, or passing inner functions as delegates (or
 has safe ways to allow this (stack frame promoted to heap etc)))
It doesn't horrify me, I just think the subset D's won't sell. It's enough work to learn one language, not three!
Aug 16 2003
next sibling parent reply "Philippe Mori" <philippe_mori hotmail.com> writes:
"Walter" <walter digitalmars.com> a écrit dans le message de
news:bhmbi1$g24$2 digitaldaemon.com...
 "Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
 news:bhm1ga$1e4$1 digitaldaemon.com...
 I'm sure it would horrify you that I would also like to see the system
taken
 to what to me seem a logical conclusion of having
 D+ (superset of D syntax with goto and other "unsafe features")
 D  (the core D with a few "unsafe" ops but not too many)

 sliceing stack alloced arrays, or passing inner functions as delegates
(or
 has safe ways to allow this (stack frame promoted to heap etc)))
It doesn't horrify me, I just think the subset D's won't sell. It's enough work to learn one language, not three!
Maybe 3 warning levels: - for beginner, - for intermediate user - for advanced one... and the default one would be intermediate.
Aug 16 2003
parent "Walter" <walter digitalmars.com> writes:
"Philippe Mori" <philippe_mori hotmail.com> wrote in message
news:bhmk07$r98$1 digitaldaemon.com...
 Maybe 3 warning levels:
 - for beginner,
 - for intermediate user
 - for advanced one...

 and the default one would be intermediate.
Warnings sure are a seductive siren - they enable me to avoid making a hard choice. But after years of experience with warnings in C/C++ compilers, I've concluded that having a warning is either a fault in the language, or a lack of conviction the language designer has. Warnings are problematic for development managers, because are they a real bug or not? Some managers decree "thou shalt compile with all warnings enabled and none shall be tripped." This runs aground when some other compiler issues mutually contradictory warnings. Others download a package off the internet, and try to compile it. It gets warnings. Is the code broken? Do the warnings matter or should I ignore them? Hence my eventual conclusion that code should either pass through the compiler cleanly or it should not. Each proposed warning should be evaluated and the language designer needs to make a decision of whether it is an error or not an error, or should the design be changed. In other words, a set of N warnings means there are actually N factorial different languages being compiled.
Aug 16 2003
prev sibling parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:bhmbi1$g24$2 digitaldaemon.com...
 "Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
 news:bhm1ga$1e4$1 digitaldaemon.com...
 I'm sure it would horrify you that I would also like to see the system
taken
 to what to me seem a logical conclusion of having
 D+ (superset of D syntax with goto and other "unsafe features")
 D  (the core D with a few "unsafe" ops but not too many)

 sliceing stack alloced arrays, or passing inner functions as delegates
(or
 has safe ways to allow this (stack frame promoted to heap etc)))
It doesn't horrify me, I just think the subset D's won't sell. It's enough work to learn one language, not three!
every using unsafe) and D+ for whose who want C++ stack scribbles and all. the same syntax, just extra features (or extra types, pointer for instance (although I would accept the point of view that there are 3 sets of conditions so its kind of 1 + 3 halfs so 2.5 langs) I still don't realy know who your trying to sell D to, so can't comment on if they would buy it or not. it brings to mind a quote/puzzle my grandfather's used to always say to me as a kid which was how many beans make 5 ? (A. 4 a seller, 6 a buyer) what sells your computer lang ( interfaces and VM from the designer, MI and cross platform from marketing)
Aug 16 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
news:bhmkc2$s28$1 digitaldaemon.com...
 I still don't realy know who your trying to sell D to, so can't comment on
 if they would buy it or not.
C and C++ programmers who like the advantages of those languages but are ready to move on past the problems with them. Java pulled too much out to appeal to me.
Aug 16 2003
parent "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:bhn31p$1ho9$1 digitaldaemon.com...
 "Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
 news:bhmkc2$s28$1 digitaldaemon.com...
 I still don't realy know who your trying to sell D to, so can't comment
on
 if they would buy it or not.
C and C++ programmers who like the advantages of those languages but are ready to move on past the problems with them. Java pulled too much out to appeal to me.
as I've said before ... semanitics instead of implementation (and a more robustness features) I'm still a little unsure: advantages and problems are very subjective terms, to some putting objects onto the stack is an advantage, to others a disadvantage or potential bug waiting to go off. and what architectures, Arm/thumb for instance is a great arch, waiting for someone to write a lang that solves the interworking problems. and the new PalmOS devices is a pain 68k under emulator with Arm/thumb (on hardware) or x86 on the simulator.
Aug 17 2003
prev sibling next sibling parent reply "Frank D. Wills" <fdwills sandarh.com> writes:
Walter wrote:
 "Martin M. Pedersen" <martin moeller-pedersen.dk> wrote in message
 news:bhgh13$flp$1 digitaldaemon.com...
 
"Charles Sanders" <sanders-consulting comcast.net> wrote in message
news:bhgdqv$cfh$1 digitaldaemon.com...

It would be more elegenat if you didnt use goto's :P.
I know, but still, "goto" is part of the language.
Goto's are like pointers. You rarely need them, but when you do, they're real nice to have!
Walter, if Matthew Wilson doesn't mind me quoting him, what you say sounds very naive.
Aug 15 2003
parent "Sean L. Palmer" <palmer.sean verizon.net> writes:
WTF?

Dude?  Are you the same Frank D. Wills that was ranting just before?

That's a total 180.

Sean

"Frank D. Wills" <fdwills sandarh.com> wrote in message
news:bhjsak$kif$1 digitaldaemon.com...
 Walter wrote:
 "Martin M. Pedersen" <martin moeller-pedersen.dk> wrote in message
 news:bhgh13$flp$1 digitaldaemon.com...

"Charles Sanders" <sanders-consulting comcast.net> wrote in message
news:bhgdqv$cfh$1 digitaldaemon.com...

It would be more elegenat if you didnt use goto's :P.
I know, but still, "goto" is part of the language.
Goto's are like pointers. You rarely need them, but when you do, they're real nice to have!
Walter, if Matthew Wilson doesn't mind me quoting him, what you say sounds very naive.
Aug 16 2003
prev sibling parent Derek Parnell <derek.parnell no.spam> writes:
On Fri, 15 Aug 2003 16:08:29 -0700 (08/16/03 09:08:29)
, Walter <walter digitalmars.com> wrote:

 "Martin M. Pedersen" <martin moeller-pedersen.dk> wrote in message
 news:bhgh13$flp$1 digitaldaemon.com...
 "Charles Sanders" <sanders-consulting comcast.net> wrote in message
 news:bhgdqv$cfh$1 digitaldaemon.com...
 It would be more elegenat if you didnt use goto's :P.
I know, but still, "goto" is part of the language.
Goto's are like pointers. You rarely need them, but when you do, they're real nice to have!
I'm in 100% agreement with Walter here. However the emphasis is on *when you NEED them*. What would be nice to have is an understanding on what situations exist that we need to have a goto. I vaguely remember reading Knuth (and I paraphrase) saying that the *only* justification for goto is in the single situation that ... 1) Needs (in order to satisify requirements) to execute as fast as possible AND 2) Cannot be written that way without a goto. I tend to agree with that too. However, if that is really the situation, the 'reverting' to assembler seems a better way to do it. My philosophy with respect to using goto is that I refuse to use it in any language that is 'higher' than assembler. My primary reason for this stance is that the possiblity of goto being used increases the number of potential logic paths that have to be understood by a maintenance coder. Thus the net effect is that maintenace takes longer. A secondary reason is that the possibility of unintended side-effects increases when using gotos - making the probability of code using goto more prone to bugs. I believe that goto increases bugs because without goto you cannot explictly jump to an unintended location, that is, it is with goto it is possible to incorrectly specify a goto target and without goto you cannot. That increased risk is enough for me to reject the use of goto. For other coders, it maybe an acceptable risk - and that's fine too. If they are willing to pay the increased cost that such code will impose then there is no issue. The argument that goto can increase runtime effeciency and is therefore justifiable, fails to impress me. True, it can speed up programs. But can it do that to such an extent that it is significant to the people using the program. Other factors tend to swamp or negate the goto speed ups, such as disk I/O, User I/O (keyboard and mouse activity), processor cacheing... I recognise that there are times that extreme speed is required, and in such cases then do it in assembler, if you are really serious. The maintenance costs might otherwise make it not worth while. But back to D. I regard a label as being a placeholder in the code. A bookmark, if you will. It represents a named location in the executable (generated) code. To force a coder to write in a empty D statement after a label, in order to satisfy the requirements of the parser is just plain silly. -- Derek
Aug 17 2003
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"Martin M. Pedersen" <martin moeller-pedersen.dk> wrote in message
news:bhgh13$flp$1 digitaldaemon.com...
 "Charles Sanders" <sanders-consulting comcast.net> wrote in message
 news:bhgdqv$cfh$1 digitaldaemon.com...
 It would be more elegenat if you didnt use goto's :P.
I know, but still, "goto" is part of the language.
A "goto" is invaluable if you're using D as a back-end for another language, since all control structures can be represented by if's and goto's.
Aug 15 2003
next sibling parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:bhjsnl$l61$1 digitaldaemon.com...
 "Martin M. Pedersen" <martin moeller-pedersen.dk> wrote in message
 news:bhgh13$flp$1 digitaldaemon.com...
 "Charles Sanders" <sanders-consulting comcast.net> wrote in message
 news:bhgdqv$cfh$1 digitaldaemon.com...
 It would be more elegenat if you didnt use goto's :P.
I know, but still, "goto" is part of the language.
A "goto" is invaluable if you're using D as a back-end for another
language,
 since all control structures can be represented by if's and goto's.
that's a big "IF". or should it be a why ? does it not make more sense to have an interface to the D compilers backend so you feed it an ast/dag instead (there are lots of tools for creating asts from langs, very few for creating dag froms ast and less code from dag). I'll have to come back to the requirement of goto to do goto! as a challenge I have set my self the task of re-writing int func( int a, int b ) { int c = a+b; while( --a > 0 ) { if ( a < b ) { goto horrid; } } while( c < b * 2 ) { b += a; if ( b < a ) { horrid: a = a << 1; } } return a+b; } the obvious way is to change the goto to call an inner function that is a copy of the code path from `horrid` round the loop .... (easier at ast level than source) and in a way justifies my belief that a back end should take an ast not a human readble lang (or not a designed for human creation lang).
Aug 15 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
news:bhjuji$mri$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> wrote in message
 news:bhjsnl$l61$1 digitaldaemon.com...
 "Martin M. Pedersen" <martin moeller-pedersen.dk> wrote in message
 news:bhgh13$flp$1 digitaldaemon.com...
 "Charles Sanders" <sanders-consulting comcast.net> wrote in message
 news:bhgdqv$cfh$1 digitaldaemon.com...
 It would be more elegenat if you didnt use goto's :P.
I know, but still, "goto" is part of the language.
A "goto" is invaluable if you're using D as a back-end for another
language,
 since all control structures can be represented by if's and goto's.
that's a big "IF". or should it be a why ? does it not make more sense to have an interface to the D compilers backend so you feed it an ast/dag instead (there are lots of tools for creating asts from langs, very few
for
 creating dag froms ast and less code from dag).
It's no different than people using C as a back end to their language Z, and many many people (including myself) have wanted to make C as the output of D. Supporting goto isn't hard, why close the door on such uses?
Aug 15 2003
parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:bhk2kn$qfh$1 digitaldaemon.com...
 "Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
 news:bhjuji$mri$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> wrote in message
 news:bhjsnl$l61$1 digitaldaemon.com...
 A "goto" is invaluable if you're using D as a back-end for another
language,
 since all control structures can be represented by if's and goto's.
that's a big "IF". or should it be a why ? does it not make more sense
to
 have an interface to the D compilers backend so you feed it an ast/dag
 instead (there are lots of tools for creating asts from langs, very few
for
 creating dag froms ast and less code from dag).
It's no different than people using C as a back end to their language Z,
and
 many many people (including myself) have wanted to make C as the output of
 D. Supporting goto isn't hard, why close the door on such uses?
C is just used because there are no easily availiable tools for ast->optimised code why not open the door on the D back end ... for example the Java language does not support the full range of operations that the Java VM supports. why not have an interface (in D) to allow the user to pass an ast to the intermediate or back end which can create C,D,or OS linkable object files. this way you can open up more than just goto, one feature of most CPUs that emulator and VM writers use is jumping into a function that has the same params (rather than calling it) [akin to tail recursion optimisations] void op1( context * ctx ) { ctx.a ++; } void op2( context * ctx ) { ctx.b ++; } void func( context * ctx ) { switch( ctx.op ) { case 1: op1( ctx ); case 2: op2( ctx ); } } or even void function(context * ctx )[] flut = { op1, op2 } void func( context * ctx ) { if (ctx.op < flut.length ) { flut[ctx.op](ctx); } } when you want to write naked void op1( context * ctx ) { ctx.a ++; } naked void op2( context * ctx ) { ctx.b ++; } void func( context * ctx ) { switch( ctx.op ) { case 1: jump op1; case 2: jump op2; } } or void func( context * ctx ) { if (ctx.op < flut.length ) { jump flut[ctx.op]; } }
Aug 16 2003
next sibling parent "Walter" <walter digitalmars.com> writes:
"Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
news:bhl7fi$29vq$1 digitaldaemon.com...
 It's no different than people using C as a back end to their language Z,
and
 many many people (including myself) have wanted to make C as the output
of
 D. Supporting goto isn't hard, why close the door on such uses?
C is just used because there are no easily availiable tools for ast->optimised code why not open the door on the D back end ...
Because that's far, far more work than just adding a goto statement!
Aug 16 2003
prev sibling parent Ilya Minkov <midiclub 8ung.at> writes:
Mike Wynn wrote:
 C is just used because there are no easily availiable tools for
 ast->optimised code
 why not open the door on the D back end ...
I have seen a number of good efforts, which so far have had little support, and thus results are mediocre. * C-- "portable assembly language" - a language to be output by compilers as intermediate. Lower-level than C, solves a number of its shortcomings as intermediate. Current compiler is experimental, LCC-based, non-optimised. If someone would make a GCC-based compiler for the language, this could be a worthy target. http://www.cminusminus.org/ * TenDRA C++ compiler generates bytecode as intermediate language, called "Architectural Neutral Distribution Format" (ANDF). Which, in turn, is compiled ahead of time on the target machine to generate an executable. There are a number of back-ends for this one, both commercial and free. I believe the free x86 back-end is very new, and is non-optimised yet. The project seemed almost dead for a while, but now it's back to activity. I believe this may become a very worthy target. http://www.tendra.org/ http://www.tendra.org/news/interest.html There must also be others, i just can't remember. So far all free, cross-platform compiler back-ends i've seen except for GCC have most of their targets in "experimental" state, not very optimised. No wonder, since it takes so many years dedicated work for each! -eye
Aug 16 2003
prev sibling parent "Matthew Wilson" <matthew stlsoft.org> writes:
Doesn't all this argy-bargy boil down to this:

1. No language is perfect
2. No practitioner is perfect
3. There are conflicting tradeoffs in all software between correctness,
robustness, performance, maintainability, ease-of-developement, portability.
4. A consequence of 1, 2 & 3 will always require the occasional (and the
less frequent the better) recourse to the grungy and nasty

I've recently read Robert Glass' Facts and Fallacies of Software
Engineering, and it's the first software engineering non-coding book I've
ever read that truly made sense. I think I would disagree with no more than
a handful of the things he said in it. Pretty much the main point he makes
is that no languages (or methodologies) are perfect, and that the best
quality software relies, almost entirely, on having talented and motivated
individuals than it does on having particular tools, or management methods,
or the next great development methodological panacea, or even particular
languages.

Given that he has a long and distinguished career as practioner, academic
and writer in IT, I am prepared to go out on a limb and be encouraged that
he talks sense to me, rather than imagine that he's the only other SE
practitioner in the world besides myself who believes in the truth of 1, 2 &
3. Maybe, maybe not.

But then there's Kent Beck, and Walter, and Alex Stepanov, and Steve
Dewhurst, and Bill Gates, and Fred Brooks, and about 50 former colleagues,
and many many smart people on the D newsgroup, and ...
Aug 15 2003