Click here to Skip to main content
15,867,141 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
AnswerRe: What is your language feature wish list? Pin
Niels Holst1-Feb-23 21:15
professionalNiels Holst1-Feb-23 21:15 
GeneralRe: What is your language feature wish list? Pin
trønderen2-Feb-23 2:34
trønderen2-Feb-23 2:34 
GeneralRe: What is your language feature wish list? Pin
Niels Holst2-Feb-23 3:26
professionalNiels Holst2-Feb-23 3:26 
GeneralRe: What is your language feature wish list? Pin
trønderen2-Feb-23 4:18
trønderen2-Feb-23 4:18 
GeneralRe: What is your language feature wish list? Pin
Niels Holst2-Feb-23 4:22
professionalNiels Holst2-Feb-23 4:22 
AnswerRe: What is your language feature wish list? Pin
Cpichols2-Feb-23 1:33
Cpichols2-Feb-23 1:33 
GeneralRe: What is your language feature wish list? Pin
Jeremy Falcon2-Feb-23 6:44
professionalJeremy Falcon2-Feb-23 6:44 
AnswerRe: What is your language feature wish list? Pin
trønderen2-Feb-23 4:06
trønderen2-Feb-23 4:06 
Loop enhancements:

First iteration statements executed in loop context.
An optional 'break code' added to a 'break', to indicate why a loop is prematurely terminated
'Handlers' that executes in the context of the loop, for each break code. 'finally', like in exception handling.

E.g.:
C#
for (record r = head; r; r = r.next) {

  initloop: {
    int iterationCount = 0;
    record trailer = null;
    int accumulated = 0;
  }
  ...
  if (++iterationCount > limit) break : GivingUp;
  ...
  if (r.key == desiredKey) break : RecordFound;
  ...
  trailer = r;
  accumulated += r.value;

  exitbreak (GivingUp): { 
    Console.WriteLine("Possible circular list: " + head.listname;
    Console.WriteLine("Giving up after " + iterationCount + " iterations");
  }

  exitbreak (RecordFound): {               // process r, with access to loop local variables, e.g. 
    if (trailer == null) head = r.next;
    else trailer.next = r.next;
    r.sumOfPreceding = accumulated; 
    // save r on disk 
  }

  exitloop: { 
   Console.Writeline(desiredKey + " not found among " + iterationCount + " records");
  }

  finally: { 
   <actions executed in loop context regardless of exit reason> 
  }
}
This would keep all the action related to the loop as one syntactical unit. It would reduce variable clutter for reporting the loop termination, and termination actions would have access to variables relevant to the loop alone.

The above actions, expressed without these enhancements, would require a handful of (loop) global variables, and the semantics would be spread out before the loop, in the loop and after the loop, not as one syntactical unit. Alternately, the loop body would have several if/else levels of nesting and it would be difficult to identify the exit actions as such.
AnswerRe: What is your language feature wish list? Pin
BernardIE53172-Feb-23 6:32
BernardIE53172-Feb-23 6:32 
GeneralRe: What is your language feature wish list? Pin
trønderen2-Feb-23 12:00
trønderen2-Feb-23 12:00 
AnswerRe: What is your language feature wish list? Pin
Member 133016792-Feb-23 9:02
Member 133016792-Feb-23 9:02 
AnswerRe: What is your language feature wish list? Pin
englebart2-Feb-23 14:35
professionalenglebart2-Feb-23 14:35 
AnswerRe: What is your language feature wish list? Pin
Chad3F3-Feb-23 10:00
Chad3F3-Feb-23 10:00 
GeneralCCC 01-02-2023 Pin
pkfox31-Jan-23 22:08
professionalpkfox31-Jan-23 22:08 
GeneralRe: CCC 01-02-2023 Pin
FreedMalloc31-Jan-23 22:48
FreedMalloc31-Jan-23 22:48 
GeneralRe: CCC 01-02-2023 - winner ! Pin
pkfox31-Jan-23 23:02
professionalpkfox31-Jan-23 23:02 
GeneralRe: CCC 01-02-2023 - winner ! Pin
OriginalGriff31-Jan-23 23:08
mveOriginalGriff31-Jan-23 23:08 
GeneralRe: CCC 01-02-2023 - winner ! Pin
pkfox31-Jan-23 23:41
professionalpkfox31-Jan-23 23:41 
GeneralRe: CCC 01-02-2023 - winner ! Pin
FreedMalloc1-Feb-23 2:46
FreedMalloc1-Feb-23 2:46 
GeneralWordle 592 Pin
StarNamer@work31-Jan-23 13:51
professionalStarNamer@work31-Jan-23 13:51 
GeneralRe: Wordle 592 Pin
Sandeep Mewara31-Jan-23 15:24
mveSandeep Mewara31-Jan-23 15:24 
GeneralRe: Wordle 592 Pin
Amarnath S31-Jan-23 16:07
professionalAmarnath S31-Jan-23 16:07 
GeneralRe: Wordle 592 Pin
Shane010331-Jan-23 17:23
Shane010331-Jan-23 17:23 
GeneralRe: Wordle 592 Pin
OriginalGriff31-Jan-23 19:04
mveOriginalGriff31-Jan-23 19:04 
GeneralRe: Wordle 592 Pin
den2k8831-Jan-23 20:45
professionalden2k8831-Jan-23 20:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.