IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New How does it know where the blocks end?
Does it use indentation? Does it nest them? (So that BLOCK_C would be in BLOCK_B.) Does it assume that they don't nest? (So BLOCK_C is not in BLOCK_B but "Some more code" accidentally is in BLOCK_C.) Does it depend on cues that depend on the kind of block? (So an IF might naturally terminate at an unexpected ELSE while a simple block remains open...)

It seems like a potentially confusing feature unless the rules are clear. If they are simple (eg it just assumes that when you close a named block then you close all other open blocks there) then it seems like a minor piece of syntactic sugar.

Anyways my limited understanding was that PL/I had exactly this kind of DWIMery built-in, which is why people who disliked Perl tended to likewise dislike PL/I.

Cheers,
Ben
"good ideas and bad code build communities, the other three combinations do not"
- [link|http://archives.real-time.com/pipermail/cocoon-devel/2000-October/003023.html|Stefano Mazzocchi]
New It doesn't
Space does not matter, I just did that to show you.
Only on the final END does it matter.
This sugar is meant for when there are multiple ends,
one after the other, with no code in between being executed.


And like I said, there are many things I like about it.
But this threw me as a major danger.
New There must be SOME rule
Obviously when it parses that code it inserts in the needed ENDs.

My question is where and why it decides to insert them.

If you don't (or can't) know that reliably, then this definitely is very dangerous since you will never be sure what that snippet will do.

Ben
"good ideas and bad code build communities, the other three combinations do not"
- [link|http://archives.real-time.com/pipermail/cocoon-devel/2000-October/003023.html|Stefano Mazzocchi]
New Yup
At the final named "END"
New So it nests blocks
In your example, BLOCK_C is inside of BLOCK_B, and "some more code" is also in BLOCK_C (and hence in BLOCK_B).

Seems sane enough. I just wouldn't name any ENDs. :-)

(Logic that is nested deeply enough that removing the END statements seems like a big win has obvious problems - namely that it is nested too deeply for my sanity.)

Cheers,
Ben
"good ideas and bad code build communities, the other three combinations do not"
- [link|http://archives.real-time.com/pipermail/cocoon-devel/2000-October/003023.html|Stefano Mazzocchi]
New Breaks a coding practice of mine
I ALWAYS comment the ending brace of blocks.
So it would be natural for me to name the END statement.

Which means I am open to breakage if I ever miss a name.
New Re: How does it know where the blocks end?
If the END is followed by a <statement-label> (before the semicolon), it closes that block and any unclosed interior blocks. If the END is not followed be a <statement-label>, it simply closes the preceding unclosed block.
If a statement-label follows END, the END statement closes the unclosed group or block headed by the nearest preceding DO, SELECT, BEGIN, or PROCEDURE statement having that statement-label. It also closes any unclosed groups or blocks physically within that group or block; this is known as multiple closure.

If a statement-label does not follow END, the END statement closes the one group or block headed by the nearest preceding DO, SELECT, BEGIN, or PROCEDURE statement for which there is no other corresponding END statement.
[link|http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/ibm3l101/7.17?DT=19950506201638|IBM Link].
Alex

In every country and every age, the priest had been hostile to Liberty. -- Thomas Jefferson (1743-1826), US president
     MF Language choices - (broomberg) - (29)
         Re: MF Language choices - (deSitter) - (9)
             How would I check for XEDIT? - (broomberg) - (4)
                 tso %xedit dataset.name? no idea - (deSitter) - (2)
                     No Xedit - (broomberg) - (1)
                         ISPF can be very powerful. - (static)
                 no XEDIT - (cforde)
             REXX issues - (broomberg) - (3)
                 Re: REXX issues - (deSitter) - (2)
                     Where to get RXVSAM - (deSitter)
                     Thanks - (broomberg)
         Isn't there a modern version/update of QuickJob? - (tablizer)
         I know less about mainframes than you do but... - (ben_tilly) - (17)
             Yup. - (broomberg) - (16)
                 Is it just me? - (drewk) - (15)
                     It is not just you - (ben_tilly) - (9)
                         It's both of you - (broomberg) - (8)
                             Not what threw me - (drewk)
                             How does it know where the blocks end? - (ben_tilly) - (6)
                                 It doesn't - (broomberg) - (4)
                                     There must be SOME rule - (ben_tilly) - (3)
                                         Yup - (broomberg) - (2)
                                             So it nests blocks - (ben_tilly) - (1)
                                                 Breaks a coding practice of mine - (broomberg)
                                 Re: How does it know where the blocks end? - (a6l6e6x)
                     I took it: - (folkert) - (4)
                         I wish - (broomberg) - (3)
                             Feels very old-fashioned. - (static) - (2)
                                 Hand code baby - (broomberg) - (1)
                                     ... and I thought of that, too. - (static)

Powered by a Chair of Comparative Owl Entrails!
68 ms