Personally, I have a utility named  ntt  (noun to text) defined in my
startup script:

           ntt =: 3 : '5!:5 < ''y'' '

So usually, I simply type out the naked sentence (i.e. without quotes),
then highlight it and copy it to my clipboard.  Then:


        
           0{"1 (1!:0 'addons')
        +------+
        |addons|
        +------+
        
           ntt wdclipread ''
        '0{"1 (1!:0 ''addons'')'
        
           wdclipwrite ntt wdclipread ''
        24


So now  '0{"1 (1!:0 ''addons'')'  is on my clipboard.  I can then paste it
wherever I need in the target sentence.  I have various shortcuts defined
in my utility script, e.g.  ntt@:wdclipread  or  ntt&.(wdclipread :
wdclipwrite)  .

-Dan


----- Original Message ---------------

Subject: [Jchat] double single quoting
   From: Joe Bogner <[email protected]>
   Date: Mon, 11 Aug 2014 22:25:02 -0400
     To: [email protected]

Often I need to do

6!:2 'f ''a'''

or

dissect '0{"1 (1!:0 ''addons'')'

or

(3 : 'smoutput ''hi''')''

It can be tricky to keep track of the double single quotes. Does
anyone have any tricks or use any functions to make it easier?

This is primarily in the interpreter, not for user in a production script

Something like:

quo =: ('`';'''') rplc~ ]

dissect quo '0{"1 (1!:0 `addons`)'

The backtick may not be the best choice for everyone, but I don't
often use it in strings

The nice thing is I can then just hit ctrl+shift+up to get the last
statement and then drop the first part to get quo '0{"1 (1!:0
`addons`)' and then copy and paste the string to run it standalone
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to