This is an interesting question: how would
you think and what are the practices in
tacit programming.
0th you need test cases: what data is input
and output.
First thing different from C++ is that J
is highly interective, which allow incremental
experimenting.
Then you build from bottom up adding more
operations using parens (...) instead of
of name.
Finally, creating names when needed.
4 #. 3 2 1 NB. test case
57
57 (^.~) 4 NB. incremental
2.91645
57 (1 + ^.~) 4
3.91645
57 ([: <. 1 + ^.~) 4
3
57 (] #~ [: <. 1 + ^.~) 4
4 4 4
57 ([ #:~ ] #~ [: <. 1 + ^.~) 4
3 2 1
NB. new name
base=: [ #:~ ] #~ [: <. 1 + ^.~
57 base 4
3 2 1
--- Ed Keith <[EMAIL PROTECTED]> wrote:
> I'm coming to J from a C++ background. While much of J
> requires a new mind set, I think I am getting most of
> it, but I'm just not getting tacit programming. I
> cannot figure out anything that is not trivial.
>
> For example I recently wrote the following verb:
>
> base =: dyad : '((<. 1 + y ^. x) # y) #: x'
>
> It takes a number and a base and and produces an array
> of digits to represent the number in the base.
>
> How would this be written tacitly? I'm not so much
> interested in how to write this verb, but how to think
> through the creation of a tacit verb.
>
> Any assistance is appreciated,
>
> Thank you,
>
> EdK
>
> Ed Keith
> [EMAIL PROTECTED]
>
> Blog: edkeith.blogspot.com
>
>
>
> ____________________________________________________________________________________
> Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel
> and lay it on us.
> http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell.
http://searchmarketing.yahoo.com/
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm