Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: No break or continue statements?

No break or continue statements? 08 Jan 2004 11:38 #6607

  • Antti Hyrkk
  • Antti Hyrkk's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 43
  • Karma: 0
Hello

Why there are no break- and continue-statements in TTCN-3, to be used with
the loop statements?

Best Regards
Antti Hyrkkanen
The administrator has disabled public write access.

No break or continue statements? 08 Jan 2004 12:42 #6608

Hello Antti,

I don't know if there were any specific reason not to include such a
statement other than the fact that the 'goto' construct already can be used
for this purpose.

Regards,
/Johan



Original Message
From: Antti Hyrkkanen [This email address is being protected from spambots. You need JavaScript enabled to view it.]
Sent: den 8 januari 2004 12:39
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: No break or continue statements?

Hello

Why there are no break- and continue-statements in TTCN-3, to be used with
the loop statements?

Best Regards
Antti Hyrkkanen
The administrator has disabled public write access.

No break or continue statements? 08 Jan 2004 14:40 #6609

hello all,

I would like to add the following question to this hot debate:

Why do we need GOTOs in TTCN-3. I always thought it was a scientific chic to
avoid GOTOs.

I of course already know the answer to that question, but I am curious to
hear about other ideas.

cheers
Bernard

>
> From: Johan Nordin <This email address is being protected from spambots. You need JavaScript enabled to view it.>
> Date: 2004/01/08 Thu AM 07:42:55 EST
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: No break or continue statements?
>
> Hello Antti,
>
> I don't know if there were any specific reason not to include such a
> statement other than the fact that the 'goto' construct already can be used
> for this purpose.
>
> Regards,
> /Johan
>
>
>
>
Original Message
> From: Antti Hyrkkanen [This email address is being protected from spambots. You need JavaScript enabled to view it.]
> Sent: den 8 januari 2004 12:39
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: No break or continue statements?
>
> Hello
>
> Why there are no break- and continue-statements in TTCN-3, to be used with
> the loop statements?
>
> Best Regards
> Antti Hyrkkanen
>
The administrator has disabled public write access.

No break or continue statements? 08 Jan 2004 14:55 #6610

ext Bernard Stepien wrote:

>hello all,
>
> I would like to add the following question to this hot debate:
>
> Why do we need GOTOs in TTCN-3. I always thought it was a scientific chic to
avoid GOTOs.
>
> I of course already know the answer to that question, but I am curious to
hear about other ideas.
>
>

Well, from an expressivity point of view, we do not need them, I think.
'repeat' (which is already part of the language), 'break' and 'next'
(which could be added) would give us all that we need when writing TTCN-3.

There are at least two cases for gotos:

1) Conversion from TTCN-2, where they were allowed.
2) Automatically generated code. When generating code automatically,
certain constructs can be rather elegantly be expressed with
lables/gotos, which would otherwise require extensive nesting of if
statemens, for example. The code generator should know what it is doing
and so in that case, I would consider goto as rather harmless.

My opinion on this issue.

BR

Stephan
--

Stephan Tobies Sr. Research Engineer, Nokia Research Center
~ Mobile Networks Lab, Protocol Engineering Group
E-Mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
Work Phone: +49-234-9842262
Mobile: +49-163-9842405
Fax: +49-234-9843491
Address: NRC Bochum, Meesmannstr. 103, 44807 Bochum, Germany
The administrator has disabled public write access.

No break or continue statements? 08 Jan 2004 15:15 #6611

Hi,

I think antti was asking about 'break' and 'continue' as statements which are frequently used in conventional programming languages to exit 'for' and 'while' loops.

Moikka,
stephan

Original Message
From: active_ttcn3 : mts stf133 ttcn version 3 - active members only on behalf of ext Stephan Tobies
Sent: Thu 1/8/2004 4:55 PM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Cc:
Subject: Re: No break or continue statements?



ext Bernard Stepien wrote:

>hello all,
>
> I would like to add the following question to this hot debate:
>
> Why do we need GOTOs in TTCN-3. I always thought it was a scientific chic to avoid GOTOs.
>
> I of course already know the answer to that question, but I am curious to hear about other ideas.
>
>

Well, from an expressivity point of view, we do not need them, I think.
'repeat' (which is already part of the language), 'break' and 'next'
(which could be added) would give us all that we need when writing TTCN-3.

There are at least two cases for gotos:

1) Conversion from TTCN-2, where they were allowed.
2) Automatically generated code. When generating code automatically,
certain constructs can be rather elegantly be expressed with
lables/gotos, which would otherwise require extensive nesting of if
statemens, for example. The code generator should know what it is doing
and so in that case, I would consider goto as rather harmless.

My opinion on this issue.

BR

Stephan
--

Stephan Tobies Sr. Research Engineer, Nokia Research Center
~ Mobile Networks Lab, Protocol Engineering Group
E-Mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
Work Phone: +49-234-9842262
Mobile: +49-163-9842405
Fax: +49-234-9843491
Address: NRC Bochum, Meesmannstr. 103, 44807 Bochum, Germany
The administrator has disabled public write access.

No break or continue statements? 08 Jan 2004 16:32 #6612

>hello all,
>

Salut Bernard,

> I would like to add the following question to this hot debate:
>
> Why do we need GOTOs in TTCN-3. I always thought it was a scientific chic to
avoid GOTOs.

There was a vociferous debate during the standarization period of TTCN-3
regarding whether GOTO should be completely from the notation.
If I recall correctly, it was added and then removed and then added once more to
the standard.

I suspect that the main reason why GOTO still exists in TTCN-3, was to:

a) to please those who (can, but) don't wish to program
properly.

b) to allow easier conversion from TTCN-2 to TTCN-3, although
I am of the believe that any program (ok, almost any)
can be re-written in a more structured manner such that
it does not use any GOTO's.
>
> I of course already know the answer to that question, but I am curious to
hear about other ideas.
>
>cheers
>Bernard

Those are my two Euro cents for today! :-)

Cheers,


Claude.

>--
Claude Desroches email:CDesroche@aol.com
Conformance Technologies Ltd. phone: +49 30 9606 7986
685 Cedar Point Road fax: +49 30 9606 7987
Penetanguishene Ontario, mobile 0174 701 6792
Canada
The administrator has disabled public write access.

No break or continue statements? 08 Jan 2004 16:40 #6613

In einer eMail vom Do, 8. Jan. 2004 16:15 MEZ schreibt "Dr. Schulz Stephan"
<This email address is being protected from spambots. You need JavaScript enabled to view it.>:

>Hi,
>

Hi Stephan,

>I think antti was asking about 'break' and 'continue' as statements which are
frequently used in conventional programming languages to exit 'for' and 'while'
loops.

Yes, and Johan pointed him to the use of the goto for this
purpose, which let Bernard to ask further...

Personally, I find that the ability to break out of a loop,
or skip to the next iteration in a loop is useful, however,
it is not necessary. One could do without both break and
continue.

Another issue is the misuse of the return statement, which
is counter to good software engineering principles which
states that functions should have a single entry and a single
exit point. Then again, we can't, and even don't want to,
protect or prevent the test developer from hanging himself, now do we? :-).

Cheers,

Claude.

>
>Moikka,
>stephan
>
>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active members only on
behalf of ext Stephan Tobies
> Sent: Thu 1/8/2004 4:55 PM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Cc:
> Subject: Re: No break or continue statements?
>
>
>
> ext Bernard Stepien wrote:
>
> >hello all,
> >
> > I would like to add the following question to this hot debate:
> >
> > Why do we need GOTOs in TTCN-3. I always thought it was a scientific
chic to avoid GOTOs.
> >
> > I of course already know the answer to that question, but I am curious
to hear about other ideas.
> >
> >
>
> Well, from an expressivity point of view, we do not need them, I think.
> 'repeat' (which is already part of the language), 'break' and 'next'
> (which could be added) would give us all that we need when writing TTCN-3.
>
> There are at least two cases for gotos:
>
> 1) Conversion from TTCN-2, where they were allowed.
> 2) Automatically generated code. When generating code automatically,
> certain constructs can be rather elegantly be expressed with
> lables/gotos, which would otherwise require extensive nesting of if
> statemens, for example. The code generator should know what it is doing
> and so in that case, I would consider goto as rather harmless.
>
> My opinion on this issue.
>
> BR
>
> Stephan
> --
>
> Stephan Tobies Sr. Research Engineer, Nokia Research Center
> ~ Mobile Networks Lab, Protocol Engineering Group
> E-Mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Work Phone: +49-234-9842262
> Mobile: +49-163-9842405
> Fax: +49-234-9843491
> Address: NRC Bochum, Meesmannstr. 103, 44807 Bochum, Germany
>
>
>


--
Claude Desroches email:CDesroche@aol.com
Conformance Technologies Ltd. phone: +49 30 9606 7986
685 Cedar Point Road fax: +49 30 9606 7987
Penetanguishene Ontario, mobile 0174 701 6792
Canada
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin