This caused it:
>>>
Take the follwing simple example in J:
3 {. (1&,^:100) ''
This will produce
1 1 1
but only after needlessly performing 100 concatenations.
3 {. (1&,^:_) ''
Will hang.
The Haskell equivalents of the expressions above (e.g. ``take 3 (repeat 1)'')
will print 1 1 1 and only 3 concatenations will be carried out.
<<<
I believe it is possible to come up with an equivalent
expression in Haskell both with needless computations and
that will hang.
What was this example supposed to demostrate: that
there isn't such object in J as functionally defined sequence?
-- that's a known fact; how to obtain a subset of such
sequence by means available in J? -- it was shown in the reply.
This is the distinction between a wrong answer and
a wrong question.
If you need syntactic sugar, it is also available in J
ones=: 1 & ,
take=: ^:
ones take 3 ''
1 1 1
----- Original Message ----
From: Alexander Schmolck <[EMAIL PROTECTED]>
To: General forum <[email protected]>
Sent: Tuesday, July 4, 2006 12:37:44 PM
Subject: Re: [Jgeneral] J as a functional programming language
Oleg Kobchenko <[EMAIL PROTECTED]> writes:
> There were earlier attempts to fit J into the
> wrong mold.
> Why just not use it the way it works best?
I was trying to answer the question what difficulties something like ``?''
poses to functional languages, not advocating any particular way to change or
use J. I'm not sure what gave rise to this apparent misapprehension.
'as
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm