[Jprogramming] 'for.' control command
R.E. Boss
r.e.boss at planet.nl
Fri Jun 29 16:17:31 HKT 2012
You quoted 12.3.7 of LJ incorrectly and forgot the _a part:
for_a. A do. B. end.
R.E. Boss
> -----Oorspronkelijk bericht-----
> Van: programming-bounces at jsoftware.com [mailto:programming-bounces at jsoftware.com] Namens Bo Jacoby
> Verzonden: vrijdag 29 juni 2012 9:12
> Aan: Programming forum
> Onderwerp: Re: [Jprogramming] 'for.' control command
>
> What you are doing wrong? You are thinking pascal rather than J!
>
> (($~3,#)'We wish you a Merry Christmas'),'And a Happy New Year!'
> We wish you a Merry Christmas
> We wish you a Merry Christmas
> We wish you a Merry Christmas
> And a Happy New Year!
>
> - Bo
>
>
> >________________________________
> > Fra: Charles Pechacek <cfp424fabn at hotmail.com>
> >Til: programming at jsoftware.com; support at oneclickdigital.com; ebay.techauctions at gmail.com
> >Sendt: 8:43 fredag den 29. juni 2012
> >Emne: [Jprogramming] 'for.' control command
> >
> >
> >
> >Hello
> >I have been trying to get a handle on the 'for.' control command, using a little program taken from a
> >Pascal book, of which I have written a script as follows:
> >load 'print'
> >humbug=: 3 : 0
> >for. >: i.3 do.
> >print 'We wish you a Merry Christmas'
> >end.
> >print 'And a Happy New Year!'
> >)
> >Here are the instructions, which I think are relevant, taken from the last example of section 12.3.7 of 'Learning J':
> >Another variation is the pattern for. A do. B end. in which block B is executed as many times as there are items of A.
> >However, when I run this program, all that results is a copy of the code.
> >What am I doing wrong?
> >Thanks in advance.
> >Charles
> >----------------------------------------------------------------------
> >For information about J forums see http://www.jsoftware.com/forums.htm
> >
> >
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list