On Tue, Jan 2, 2018 at 9:11 AM, wrote:
> On Monday, January 1, 2018 at 9:35:06 PM UTC, Chris Angelico wrote:
>> On Tue, Jan 2, 2018 at 7:16 AM, Chris Green wrote:
>> > Dennis Lee Bieber wrote:
>> >>
>> >> Well... "break" does bypass the rest of the block, but it still
>> >> exits
>> >> v
On Monday, January 1, 2018 at 9:35:06 PM UTC, Chris Angelico wrote:
> On Tue, Jan 2, 2018 at 7:16 AM, Chris Green wrote:
> > Dennis Lee Bieber wrote:
> >>
> >> Well... "break" does bypass the rest of the block, but it still
> >> exits
> >> via the end of the block. I have a tendency to try
On Tue, Jan 2, 2018 at 7:16 AM, Chris Green wrote:
> Dennis Lee Bieber wrote:
>>
>> Well... "break" does bypass the rest of the block, but it still exits
>> via the end of the block. I have a tendency to try for one "return" per
>> procedure (so I'm more likely to have an "if ...: break"
Dennis Lee Bieber wrote:
>
> Well... "break" does bypass the rest of the block, but it still exits
> via the end of the block. I have a tendency to try for one "return" per
> procedure (so I'm more likely to have an "if ...: break" then "if ...:
> return").
I have always tried to enforc
Sorry, delete string "n't". I mean that you would strcuture your code
with that architecture.
Hate that.
marxos
On 1/1/18, John Q Hacker wrote:
>>> I don’t use gotos in C code. Why should it be “harder” in a higher-level
>>> language?
>>
>> Good for you.
>>
>> Looking at 14 million lines of Li
>> I don’t use gotos in C code. Why should it be “harder” in a higher-level
>> language?
>
> Good for you.
>
> Looking at 14 million lines of Linux kernel sources, which are in C,
> over 100,000 of them use 'goto'. About one every 120 lines.
Most use of goto's implies a lack of understanding of th
(Posting On Python-List Prohibited)
why ?
--
https://mail.python.org/mailman/listinfo/python-list
On 01/01/2018 15:06, From wrote:
(Posting On Python-List Prohibited)
why ?
Huh?
I'm posting to the usenet group comp.lang.python (an off-topic reply to
an off-topic remark, but it happens).
I've no idea what the prohibited part is about, if that's what you're
pos
On 01/01/2018 14:54, Peter J. Holzer wrote:
On 2017-12-30 11:07:56 -0500, Dennis Lee Bieber wrote:
Yes. I don't know any language which enforces "pure" structured
programming. They all have some constructs (goto, break, return,
exceptions, ...) to leave a block early. I don't think that invali
On 2017-12-30 11:07:56 -0500, Dennis Lee Bieber wrote:
> On Sat, 30 Dec 2017 13:46:14 +0100, "Peter J. Holzer"
> declaimed the following:
>
> >I don't think this is correct. Structured programming is much older:
> >ALGOL 60 was already a block structured language and Dijkstra wrote
> >"goto consi
On Sunday, December 31, 2017 at 6:56:16 PM UTC, bartc wrote:
> On 31/12/2017 17:01, breamoreboy wrote:
>
> >Further I've never once in 17 years of using Python been tearing my hair out
> >over the lack of goto
>
> Neither have I over all the advanced features of Python I never use, and
> for do
On 01/01/2018 00:40, MRAB wrote:
On 2017-12-31 23:21, bartc wrote:
[Block delimiting]
proc fn2(int a)=
...
end
(or possibly "inline f123=").
[snip]
OT: if "case ... esac" and "if ... fi", why not "proc ... corp"? :-)
(I don't think Algol-68 used corp otherwise it might have been copied
On 31/12/2017 17:01, breamore...@gmail.com wrote:
Further I've never once in 17 years of using Python been tearing my hair out
over the lack of goto
Neither have I over all the advanced features of Python I never use, and
for double that number of years.
Yet for some they will be as indisp
On 31/12/2017 17:01, breamore...@gmail.com wrote:
I would use functions every time as a modern compiler can inline them
This
Further I've never once in 17 years of using Python been tearing my hair out
over the lack of goto
And this. (In my case only 6 years.)
--
https://mail.python.org/
bartc writes:
> On 31/12/2017 22:09, Ben Bacarisse wrote:
>
>> No, you missed the point and did not address the question. You said (now
>> cut)
>>
>> | If I thought introducing functions, whether local or not, as a way of
>> | avoiding goto was worth doing, I would do so.
>>
>> but I'm not sure
On 2017-12-31 23:21, bartc wrote:
On 31/12/2017 22:09, Ben Bacarisse wrote:
No, you missed the point and did not address the question. You said (now
cut)
| If I thought introducing functions, whether local or not, as a way of
| avoiding goto was worth doing, I would do so.
but I'm not sure y
On 31/12/2017 22:09, Ben Bacarisse wrote:
No, you missed the point and did not address the question. You said (now
cut)
| If I thought introducing functions, whether local or not, as a way of
| avoiding goto was worth doing, I would do so.
but I'm not sure you know if it's worth it or not. S
bartc writes:
> On 31/12/2017 15:02, Ben Bacarisse wrote:
>> bartc writes:
>
>> I think there's a problem with that. Standard C does not have them, you
>> said your language does not implement them properly
>
> (The real problem is I don't remember local functions being used
> anywhere else. It
On Mon, Jan 1, 2018 at 6:29 AM, bartc wrote:
> You'll need to give an example I think. Suppose I start with this:
>
> def fn(a):
> if a==1:
> print ("One")
> print ("Two")
> print ("Three")
> elif a==2:
> print ("Four")
> else:
> print ("Other")
On 31/12/2017 19:29, bartc wrote:
[Ignore the original, incomplete version of my post, which appears after
the sig.
I decided to actually try it out for real instead of just guessing!
Good thing too.]
--
https://mail.python.org/mailman/listinfo/python-list
On 31/12/2017 17:06, Chris Angelico wrote:
On Mon, Jan 1, 2018 at 3:55 AM, bartc wrote:
The suggestion was to use them to avoid gotos. If duplicating is a good
idea (and it's a hard line to draw) then we are not talking about the
same cases. Given the choice of "dragging in named functions" a
On Sunday, December 31, 2017 at 3:02:41 PM UTC, Ben Bacarisse wrote:
> bartc writes:
>
> > On 31/12/2017 12:41, Chris Angelico wrote:
> >> On Sun, Dec 31, 2017 at 11:33 PM, bartc wrote:
> >>> On 30/12/2017 23:54, Chris Angelico wrote:
> >
> I've written code that uses dirty tricks like that
On Mon, Jan 1, 2018 at 3:55 AM, bartc wrote:
>> The suggestion was to use them to avoid gotos. If duplicating is a good
>> idea (and it's a hard line to draw) then we are not talking about the
>> same cases. Given the choice of "dragging in named functions" and
>> dragging in named blocks and go
On 31/12/2017 15:02, Ben Bacarisse wrote:
bartc writes:
I think there's a problem with that. Standard C does not have them, you
said your language does not implement them properly
(The real problem is I don't remember local functions being used
anywhere else. It's an idiom I'm not used to
bartc writes:
> On 31/12/2017 12:41, Chris Angelico wrote:
>> On Sun, Dec 31, 2017 at 11:33 PM, bartc wrote:
>>> On 30/12/2017 23:54, Chris Angelico wrote:
>
I've written code that uses dirty tricks like that to avoid
duplication. It's at least as much of a problem as actual duplicatio
On 31/12/2017 12:41, Chris Angelico wrote:
On Sun, Dec 31, 2017 at 11:33 PM, bartc wrote:
On 30/12/2017 23:54, Chris Angelico wrote:
I've written code that uses dirty tricks like that to avoid
duplication. It's at least as much of a problem as actual duplication
is. Generally, the 'goto' sol
On Sun, Dec 31, 2017 at 11:33 PM, bartc wrote:
> On 30/12/2017 23:54, Chris Angelico wrote:
>>
>> On Sun, Dec 31, 2017 at 10:45 AM, bartc wrote:
>>>
>>> On 30/12/2017 23:26, Gregory Ewing wrote:
bartc wrote:
>
>
> B and C occur twice, so a goto is a quick way to reuse B
On 30/12/2017 23:54, Chris Angelico wrote:
On Sun, Dec 31, 2017 at 10:45 AM, bartc wrote:
On 30/12/2017 23:26, Gregory Ewing wrote:
bartc wrote:
B and C occur twice, so a goto is a quick way to reuse B and C without
needing to duplicate code,
This only works if the repeated part happens
bartc writes:
> On 30/12/2017 20:36, Ben Bacarisse wrote:
>> bartc writes:
>>
>>> On 30/12/2017 16:53, mm0fmf wrote:
On 30/12/2017 14:41, bartc wrote:
> it looks a bit naff
Understatement of 2017.
>>>
>>> I'm honest about my own ideas, but my remarks were about the use of
>>>
On 2017-12-30 23:22, Gregory Ewing wrote:
Stefan Ram wrote:
BASIC has
DEF FN...
which /can/ define actual subroutines, limited to expressions.
Now, what does this limitation remind me of?
The equivalent limitation in Python is nowhere near as bad,
since if you outgrow what lambda can
On Sun, Dec 31, 2017 at 10:45 AM, bartc wrote:
> On 30/12/2017 23:26, Gregory Ewing wrote:
>>
>> bartc wrote:
>>>
>>> B and C occur twice, so a goto is a quick way to reuse B and C without
>>> needing to duplicate code,
>>
>>
>> This only works if the repeated part happens to be at the
>> tail of
On 30/12/2017 23:26, Gregory Ewing wrote:
bartc wrote:
B and C occur twice, so a goto is a quick way to reuse B and C without
needing to duplicate code,
This only works if the repeated part happens to be at the
tail of each case.
IME that seems to be the most common situation.
Any other si
bartc wrote:
B and C occur twice, so a goto is a quick way to reuse B and C without
needing to duplicate code,
This only works if the repeated part happens to be at the
tail of each case. Any other situation and you're back to
local functions.
--
Greg
--
https://mail.python.org/mailman/listinf
bartc wrote:
C doesn't in general have local functions. My own languages don't
implement them properly. So I tend not to use them.
Looks like there's something circular going on here. You don't
have much experience of using local functions, so you don't
see a lot of value in them, so you haven'
Stefan Ram wrote:
BASIC has
DEF FN...
which /can/ define actual subroutines, limited to expressions.
Now, what does this limitation remind me of?
The equivalent limitation in Python is nowhere near as bad,
since if you outgrow what lambda can do you can always
use a def instead. BASIC
On Sun, Dec 31, 2017 at 9:43 AM, bartc wrote:
> On 30/12/2017 20:36, Ben Bacarisse wrote:
>>
>> bartc writes:
>>
>>> On 30/12/2017 16:53, mm0fmf wrote:
On 30/12/2017 14:41, bartc wrote:
>
> it looks a bit naff
Understatement of 2017.
>>>
>>>
>>> I'm honest about m
On 30/12/2017 20:36, Ben Bacarisse wrote:
bartc writes:
On 30/12/2017 16:53, mm0fmf wrote:
On 30/12/2017 14:41, bartc wrote:
it looks a bit naff
Understatement of 2017.
I'm honest about my own ideas, but my remarks were about the use of
special symbols such as "::" and "@".
Before compl
> On Dec 30, 2017, at 7:46 AM, Peter J. Holzer wrote:
>
> On 2017-12-29 19:09:35 -0500, Dennis Lee Bieber wrote:
>> On Fri, 29 Dec 2017 23:12:22 +, bartc declaimed the
>> following:
>>> Looking at 14 million lines of Linux kernel sources, which are in C,
>>> over 100,000 of them use 'goto'
On Sun, Dec 31, 2017 at 7:36 AM, Ben Bacarisse wrote:
> bartc writes:
>
>> On 30/12/2017 16:53, mm0fmf wrote:
>>> On 30/12/2017 14:41, bartc wrote:
it looks a bit naff
>>>
>>> Understatement of 2017.
>>
>> I'm honest about my own ideas, but my remarks were about the use of
>> special symbols
bartc writes:
> On 30/12/2017 16:53, mm0fmf wrote:
>> On 30/12/2017 14:41, bartc wrote:
>>> it looks a bit naff
>>
>> Understatement of 2017.
>
> I'm honest about my own ideas, but my remarks were about the use of
> special symbols such as "::" and "@".
>
> Before completely dismissing it however
On Sat, Dec 30, 2017 at 8:41 AM, bartc wrote:
> (I had introduced a special language feature just for this kind of thing,
> but it was unsatisfactory. Goto was simpler and understood by everyone. And
> portable to any other language - that hasn't done away with goto. But it
> worked like this (not
On 2017-12-30 18:21, bartc wrote:
On 30/12/2017 16:53, mm0fmf wrote:
On 30/12/2017 14:41, bartc wrote:
it looks a bit naff
Understatement of 2017.
I'm honest about my own ideas, but my remarks were about the use of
special symbols such as "::" and "@".
Before completely dismissing it howev
On 30/12/2017 16:53, mm0fmf wrote:
On 30/12/2017 14:41, bartc wrote:
it looks a bit naff
Understatement of 2017.
I'm honest about my own ideas, but my remarks were about the use of
special symbols such as "::" and "@".
Before completely dismissing it however, you should look at how anothe
On 30/12/2017 14:41, bartc wrote:
it looks a bit naff
Understatement of 2017.
--
https://mail.python.org/mailman/listinfo/python-list
On 30/12/2017 03:05, Lawrence D’Oliveiro wrote:
On Saturday, December 30, 2017 at 12:12:23 PM UTC+13, bartc wrote:
Looking at 14 million lines of Linux kernel sources, which are in C,
over 100,000 of them use 'goto'. About one every 120 lines.
That kind of thing leads to spaghetti code.
Here
On 2017-12-29 19:09:35 -0500, Dennis Lee Bieber wrote:
> On Fri, 29 Dec 2017 23:12:22 +, bartc declaimed the
> following:
> >Looking at 14 million lines of Linux kernel sources, which are in C,
> >over 100,000 of them use 'goto'. About one every 120 lines.
> >
>
> C is a language that
On Saturday, December 30, 2017 at 8:35:27 AM UTC+5:30, Lawrence D’Oliveiro
wrote:
> On Saturday, December 30, 2017 at 12:12:23 PM UTC+13, bartc wrote:
> > Looking at 14 million lines of Linux kernel sources, which are in C,
> > over 100,000 of them use 'goto'. About one every 120 lines.
>
> That
On 2017-12-29 23:12, bartc wrote:
On 29/12/2017 21:55, Lawrence D’Oliveiro wrote:
On Saturday, December 30, 2017 at 9:03:50 AM UTC+13, bartc wrote:
Why most newer, higher level languages don't, I don't know. Perhaps
because the people who design them want to make programming harder?
I don’t u
Looking at 14 million lines of Linux kernel sources, which are in C, over
100,000 of them use 'goto'. About one every 120 lines.
Isn't C's goto statement restricted to the current function? I imagine
setjmp and longjmp calls might be more insidious.
Skip
--
https://mail.python.org/mailman/listi
On 29/12/2017 21:55, Lawrence D’Oliveiro wrote:
On Saturday, December 30, 2017 at 9:03:50 AM UTC+13, bartc wrote:
Why most newer, higher level languages don't, I don't know. Perhaps
because the people who design them want to make programming harder?
I don’t use gotos in C code. Why should it b
50 matches
Mail list logo