forum-msg-id-130864-edit

Original date:2017-03-18 18:23:07 Edited by: petelomax Subject: Re: rosettacode 500 milestone passed

Spock said...

Sorry to disappoint. q.2.3 means q[2][3]

Not really a problem, it is actually quite reasonable that getToken() should be told when floats can and cannot be valid.

Spock said...

scopes are pointless inside routines - I made the conscious decision to not include them.

Fair enough

Spock said...

I just don't see the need to have any structural scopes inside routines. Perhaps someone could point out just where i got it wrong.

The only two things that spring to mind are (and you did say "kept short and simple") that in an N-00 line routine

if this then 
   -- <you are adding code here> 
else 
   if that then 
      -- loads more code 
   elsif the_other then 
      integer w 
   else 
      integer W 
      -- <then you add more here> 

First, without local mini-scopes, while working up top you forget there is a w 200 lines further down and add another one -> compilation error.
Not exactly what I'd call critical either, and that sort of thing can still happen with scopes.

Second, while working down below, you use w when you meant W, or perhaps that you can't rename/remove w without checking all the rest of the code.

Pete

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu