Double quotes represent quotes in quoted strings.
   'This is a ''test'''
This is a 'test'

But single quotes represent quotes in a multi-line :0 block:

   0 :0
This is a 'test'
)
This is a 'test'

Which could be a verb:

This=: <
is=: |.
a=: ,.
   3 :0
This is a 'test'
)
3 : 'This is a ''test'''

Note that both verbs and nouns can be given to names using =: but
verbs can also be executed

   3 :0 ''
This is a 'test'
)
┌─┐
│t│
│s│
│e│
│t│
└─┘

(That looks a lot better in a monospaced font than in a proportionally
spaced font... but computers are not yet advanced enough to reliably
use monospaced fonts...)

Thanks,

-- 
Raul

On Sat, May 25, 2019 at 2:44 PM 'Skip Cave' via Programming
<[email protected]> wrote:
>
> David-
> Now I know that I have to use double single quotes to define a blank in a
> defined verb, but I can use single quotes in a implicit verb. I need to
> remember that. Or I can just define blank as a named noun:
>
> * bk=.' '*
>
> * dab1 =. 3 :'y#~each-.each bk = each y'*
>
> * dab1 a*
>
> *┌──────────────┬──────┬───────────────┬────────────────────┐*
>
> *│Thetimehascome│forall│goodmentocometo│theaidoftheircountry│*
>
> *└──────────────┴──────┴───────────────┴────────────────────┘*
>
> Pascal -
> *    dab =: -.&' '*
>
> * dab each a*
>
> *┌────────────┬──────┬───────────────┬────────────────────┐*
>
> *│Nowisthetime│forall│goodmentocometo│theaidoftheircountry│*
>
> *└────────────┴──────┴───────────────┴────────────────────┘*
> That is really cool! much simpler!
>
> Don -
> For my problem, I have to keep the string partitions in place. However, you
> show that semicolon (Raze) removes boxes. Also semicolon, colon, semicolon
> (;:;) partitions literals into boxes at spaces . Both are tricks that I
> need to remember!
>
> * a *
>
> *┌─────────────────┬────────┬─────────────────────┬────────────────────────┐*
>
> *│The time has come│ for all│ good men to come to │the aid of their
> country│*
>
> *└─────────────────┴────────┴─────────────────────┴────────────────────────┘*
>
> * ;a*
>
> *The time has come for all good men to come to the aid of their country*
>
> * ;:;a*
>
> *┌───┬────┬───┬────┬───┬───┬────┬───┬──┬────┬──┬───┬───┬──┬─────┬───────┐*
>
> *│The│time│has│come│for│all│good│men│to│come│to│the│aid│of│their│country│*
>
> *└───┴────┴───┴────┴───┴───┴────┴───┴──┴────┴──┴───┴───┴──┴─────┴───────┘*
>
> * ;;:;a*
>
> *Thetimehascomeforallgoodmentocometotheaidoftheircountry*
>
> Cool!
>
> Skip Cave
> Cave Consulting LLC
>
>
> On Sat, May 25, 2019 at 4:52 AM Skip Cave <[email protected]> wrote:
>
> > Given a set of boxed literal strings:
> >
> > *]a=.'Now is the time';' for all';' good men to come to ';'the aid of
> > their country'*
> >
> > *┌───────────────┬────────┬─────────────────────┬────────────────────────┐*
> >
> > *│Now is the time│ for all│ good men to come to │the aid of their country│*
> >
> > *└───────────────┴────────┴─────────────────────┴────────────────────────┘*
> >
> >
> > I can remove all the blanks:
> >
> >
> >
> > *a#~ each -. each ' '= each a*
> >
> > *┌────────────┬──────┬───────────────┬────────────────────┐*
> >
> > *│Nowisthetime│forall│goodmentocometo│theaidoftheircountry│*
> >
> > *└────────────┴──────┴───────────────┴────────────────────┘*
> >
> >
> > So I try to write a 'delete all blanks' (dab) verb:
> >
> > *dab =. 3 :'y#~ each -. each ' '= each y'*
> >
> > *|noun result was required*
> >
> > *| y#~each-.each*
> >
> > What is going wrong?
> >
> >
> > Skip Cave
> > Cave Consulting LLC
> >
> ----------------------------------------------------------------------
> 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