Pascal wrote:
"Very much enjoyed your presentation."
I am glad to hear that.
Pascal wrote:
"
You make a good case for fixed tacit code, though you neglected the most
obvious argument: Just as you would not want to use global data variables
for "every thing", it follows that relying on as few external names as
possible reduces the complications that occur when those names are changed
or no longer present.
"
Perhaps I did not emphasize it early enough but it is there (near the end):
Slide 144
Note _
Fixed tacit J is:
o self-contained
o suitable for
- modular design
- automatic optimization
(supported by special code)
- elimination of unwanted side effects
o compatible
- no names, no name conflicts
- no local and no global nouns,
no local vs global conflicts
o NO WORRIES!
Pascal wrote:
"
With that said, there is a simpler approach to turning adverbs like amend
into a verb( and so usable in tacit expressions):
itmemamend =: 4 : 'x}y'
"
Further, if you do not mind bending the rules then it is not difficult
to write that kind of verbs tacitly as well, for example,
JVERSION
Installer: j602a_win.exe
Engine: j701/2011-01-10/11:25
Library: 6.02.023
itemamend=.(<'`:')(0:`)(,^:)&6@:(([ , (<'}') , ])&:(<@:((":0) ,&< ])))
3 1 0 2 1 itemamend (a.{~(a.i.'A')+i.4 5)
PGCNJ
type 'itemamend'
┌────┐
│verb│
└────┘
On Tue, Jul 22, 2014 at 1:15 PM, 'Pascal Jasmin' via Programming <
[email protected]> wrote:
> Very much enjoyed your presentation. You make a good case for fixed tacit
> code, though you neglected the most obvious argument: Just as you would
> not want to use global data variables for "every thing", it follows that
> relying on as few external names as possible reduces the complications that
> occur when those names are changed or no longer present.
>
> With that said, there is a simpler approach to turning adverbs like amend
> into a verb( and so usable in tacit expressions):
>
> itmemamend =: 4 : 'x}y'
>
> there are also enhancement as to rank that can replace the simpler case
> above:
>
> itemamend2 =: (([: ;/(,.i.@#))@:[ { ])"1 _
> itemamend =: 4 : '((2}.$y) $"1 0 x)} y'
>
>
> ----- Original Message -----
> From: Jose Mario Quintana <[email protected]>
> To: Programming forum <[email protected]>
> Cc:
> Sent: Tuesday, July 22, 2014 12:39:33 PM
> Subject: Re: [Jprogramming] Tacit J and indexed replacement
>
> Don wrote:
> "I think it would be impossible to do an amendment in place in tacit code"
>
> It is not possible to amend in place tacitly in the official version of J.
> However, tacit versions of amend, and append, in-place have been
> implemented in an special version of J. These are definitively not for the
> faint of heart because the tacit writer has to assume full responsibility
> and unexpected consequences might (will eventually) happen.
>
> The following is a comparison between a tacit implementation of a Turing
> machine (utm) (for details, see the link of my talk in
> http://www.jsoftware.com/jwiki/Community/Conference2012#Schedule) and an
> (a
> partial) in-place (utmIP) version where only the sentence,
>
> T h( amend o (PRINT f ; P f ; T f ) ) f.
> <@:((0: 0&({::)@:]`(<@:(1&({::))@:])`(2&({::)@:])} ])@:(7&({::) ; 3&({::) ;
> 2&({::))) 2} ]
>
> in the utm was replaced by,
>
> (PRINT,P,T) Amend
> 7 3 2&(102!:0)
>
> in the utmIP; the array (the tape referred by T) grows to a maximum tally
> of just 1965 in this example, nevertheless, the in-place amendment makes a
> difference (Surface 2 Pro timings running on battery):
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm