Talk:Jump anywhere: Difference between revisions

→‎Signal use in Rexx: answered 'which Rexx'
(→‎Signal use in Rexx: Is Regina Documentation that important?)
(→‎Signal use in Rexx: answered 'which Rexx')
 
(5 intermediate revisions by 2 users not shown)
Line 44:
::::::: Is this the right place to discuss the Regina documentation which you seemingly do here? I haven't touched your text 'over there!'. Just tried to warn others (and maybe even you) about use of Signal. Please leave it at that and/or rephrase your text in the task if I convinced you to some extent.
I am talking here about classic Rexx and ooRexx, by the way. --[[User:Walterpachl|Walterpachl]] 20:04, 11 December 2012 (UTC)
 
: Just exactly what is it that you want to be rephrased in my text (in the REXX example)? I showed an example of a '''signal''' instruction, along with the disclaimer that some REXXes don't allow the example's method of using it (the '''signal''' instruction), although a language specification that says it's legal --- along with the ''exact'' example given in a REXX (Regina) document (I consider Regina REXX to be one of the classic REXXes). As far a what is or isn't the right place to discuss the Regina REXX language documentation, it's a good place as any as we're discussing what's legal as per the '''signal''' instruction in the REXX example shown, and also, most REXX programmers have access that particular document. I used Regina's documentation because it had the example (REXX code) that I used verbatim. I showed a working example of a '''signal''' instruction as per the task description (jump anywhere). I didn't include examples of how it can fail; every instruction can fail in some manner. Most instructions have caveats, exceptions, and ''gotchas''. '''a=a+1''' could produce a result that is unexpected, but that won't stop me from showing how to increment a REXX variable (and not showing a counterexample of possible failures). Also, I don't feel comfortable in pontificating what (REXX) statements should or shouldn't be used for this 'n that and/or under what circumstances, or even judging what (REXX) statements are "bad". Showing a (SIGNAL) failure situation without explaining why the failure occurred isn't a constructive way to warn other programmers. The conditions of why the failure (of the below shown example) occurred should be accompanied with a brief explanation of why that failure is an example of coding an ''illegal'' '''signal''' instruction construct and will cause a '''syntax''' error in REXX. -- [[User:Gerard Schildberger|Gerard Schildberger]] 21:02, 11 December 2012 (UTC)
 
:: This "discussion" is getting way too scrambled. I try to tell you what I want.
Replace your Regina oriented text at the task with something like this:
 
"Signal should only be used for very global jumps and condition handling since Signal within or into Do loops, do groups or other control structures may not work as desired" --[[User:Walterpachl|Walterpachl]] 05:03, 12 December 2012 (UTC)
 
: Sorry, but I will '''not''' pontificate to others that certain (REXX) statements should ''only'' be used for thus and thus (for whatever reason, certainly the least of which is that the '''signal''' instruction is behaving as described in a REXX language specification (jumping into a '''DO''' loop and executing a '''DO''' or '''END''' instruction '''will''' cause a REXX SYNTAX error). As I mentioned elsewhere, there are other uses of the '''signal''' instruction than "long jumps" and "conditioning handling". By the way, my ''Regina oriented text'' (whatever that means --- it doesn't use any instructions or options not available in every REXX interpreter), it isn't even a Regina REXX "program"; it was executed with PC/REXX as indicated in the REXX section header comments. I'm sorry that you can't follow this discussion. Your example (below) just shows a SYNTAX error for an illegal use of the '''signal''' instruction (the reason for the failure has been pointed out), but it fails to show a valid use of the REXX '''signal''' statement, which is what this RC task is about. If you have an valid example of the '''signal''' statement doing a "jump anywhere", then, please, add another REXX version that shows that. -- [[User:Gerard Schildberger|Gerard Schildberger]] 05:48, 12 December 2012 (UTC)
::: That's what I did right now. Hopefully in an agreeable way. Thanks --[[User:Walterpachl|Walterpachl]] 09:45, 12 December 2012 (UTC)
 
:::: Exactly which REXX interpreter did you test that code on? And also, what REXX was used for the example below? -- [[User:Gerard Schildberger|Gerard Schildberger]] 20:06, 12 December 2012 (UTC)
 
::::: The only ones I have: ooRexx and REXX/TSO --[[User:Walterpachl|Walterpachl]] 20:34, 12 December 2012 (UTC)
 
-----
 
as exemplified by this example:
 
Example:
Line 56 ⟶ 74:
Error 10.1: END has no corresponding DO, LOOP, or SELECT
</pre>
 
:: why did you explain here what I wanted to demonstrate? and what do you mean by: "There are other uses for the '''signal''' instruction than that."??
--[[User:Walterpachl|Walterpachl]] 05:03, 12 December 2012 (UTC)
 
::: I explained because just showing a SYNTAX error for an illegal use of a '''signal''' instruction isn't explaining. Non-REXX programmers won't understand why it happened. I explained what happened and WHY it happened (using a SIGNAL instruction illegally: that is, "jumping" '''into''' a DO loop and executing the END statement). Showing an invalid example of the SIGNAL instruction and then getting a REXX SYNTAX error without informing of WHY it happened isn't doing non-REXX programmers any service. As for other uses of SIGNAL, I was referring to other uses other than ''very global jumps'' and ''condition handling''. Those other uses aren't within the scope of this particular RC task, so they were obviously not included herein. I have demonstrated those uses in REXX examples elsewhere in Rosetta Code. -- [[User:Gerard Schildberger|Gerard Schildberger]] 05:48, 12 December 2012 (UTC)
 
: Please note that that your (illegal) code is "executing" the '''END''' instruction which has been rendered invalid by the execution of the '''signal''' instruction, which resulted in the '''syntax''' error (as cautioned in the comments in the REXX section header). -- [[User:Gerard Schildberger|Gerard Schildberger]] 21:02, 9 December 2012 (UTC)
2,294

edits