Yes, a good point.
As I said, I have a need for this facility occasionally, but not for
production code. Most of my programming is recreational problem-solving.
I think I used the block comment method a week or so ago in solving a numerical
Times Listener crossword, number 4673, 21 August. It was fairly
straightforward, but evidently I’d slipped up somewhere, as some answers
didn’t fit. So I needed to backtrack, in a quite logical progression from a
singleton value for H, with only a few values for e and f which were factors
of H and so on. It turned out I’d assigned 3 digits to X, not the required 4 !
So the introduction of an arbitrary early break was fully justified. This was
one-time throwaway code.
The {{ .. }} approach is fine except for the few (?) of us who try running the
same script on laptop and this iPad, which only supports J701, at least as I
use it.
Cheers,
Mike
Sent from my iPad
> On 1 Sep 2021, at 06:30, Devon McCormick <[email protected]> wrote:
>
> Ian's idea is even better: don't.
>
>> On Tue, Aug 31, 2021 at 11:05 PM Ian Clark <[email protected]> wrote:
>>
>> Ruda wrote
>>> if I load a (longer) script, I sometimes want to ignore a part of it
>>
>> I take Ruda's use of "sometimes" to mean he wants the proposed feature to
>> be switchable.
>>
>> To anyone wanting to dabble with such a feature, I have a word of advice.
>> Don't.
>> If there's part of your script you want to omit, it belongs in a separate
>> script.
>> Currently, if you load a J script, it either loads completely or signals an
>> error. Relax this axiom and you open Pandora's box.
>>
>> I once implemented a script-truncation feature, along the lines of
>> 0!:100 < hack fread 'myscript.ijs'
>> which is very roughly Mike's solution.
>> I was so taken with it I started using it routinely. Bugs were slow to
>> appear, but when they did they were destructive and inopportune, usually
>> unexpected "value errors". And I'd robbed 4!:3 and 4!:4 of their power.
>>
>> I don't want to discuss here what can go wrong. But if anyone can think
>> back to punched-card days, IBM gave us these brightly-colored
>> slash-asterisk cards (if memory serves), to insert in your card deck for
>> Ruda's purpose. They proved as mischievous as radium toothpaste.
>>
>> Don't say I didn't warn you.
>>
>> On Tue, 31 Aug 2021 at 13:27, 'Rudolf Sykora' via Programming <
>> [email protected]> wrote:
>>
>>> Dear list,
>>>
>>>
>>> if I load a (longer) script, I sometimes want to ignore a part of it
>>> beyond a certain line. Is there a way to achieve that gracefully? (I
>>> sometimes just add something syntactically wrong to stop there, on an
>>> error).
>>>
>>>
>>> Thank you.
>>> Ruda
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
>
> --
>
> Devon McCormick, CFA
>
> Quantitative Consultant
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm