Before I show how the verb WhoAmI can be produced it might helpful to
explain how it works. The verb echoes its right argument (''), discards it
and anonymously reproduces, an exact copy of, itself; then, the reproduced
verb echoes its right argument ('I am presenting myself by executing this
sentence :)') discards it and anonymously reproduces an exact copy of
itself, and so on until there are no more arguments and the reproduced verb
shows up.
The verb, with the aid of the Tacit Toolkit mentioned often in the
Adverbial Tacit Jym thread, can be written easily as a one-liner,
WhoAmI=. (body f.<adv)&(body=. ([ amper >)x [ echo y)f.
It uses the typical ancient trick that self-reproducing beings employ
(e.g., living beings): The whole being (WhoAmI) consists of a description
of the body (body f.<adv) bonded (&) to the body f. A variation of this
verb provides the means for producing general verbs that seemingly take
directly arguments as a strand (more on that later in a new thread).
A self-contained version of WhoAmI can also be written as a
slightly longer one-liner (beware of line wrapping),
WhoAmI=. (<@:(,^:(0:`(<'f.')))'body')&(body=. ([ (,^:(0:`(<'&'))) >)@:[
[ echo @:])f.
Incidentally, the display of the following sentence is slightly different
from the output in my original post (it includes extra blank lines
corresponding to the empty literals (''). It seems that JQT and JHS are
NOT behaving exactly in the same way. I am running here Win JQt05 whereas
I produced the original output with Safari on an iPad as a client of a
custom JHS on a Kindle Paperwhite server but I just confirmed that Win
JHS05 with MS Edge produces the same output (without extra blank lines).
WhoAmI '' 'I am presenting myself by executing this sentence :)' ''
'Spoiler coming in,' '' (,.|.i.33) '' (|.'...brev gnicudorper-fles eht ma
I') ''
I am presenting myself by executing this sentence :)
Spoiler coming in,
32
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
I am the self-reproducing verb...
(<([ ,^:(0:`&) >)@:[ [ 0 0&$@(1!:2&2)@:])&(([ ,^:(0:`&) >)@:[ [ 0
0&$@(1!:2&2)@:])
On Thu, Mar 23, 2017 at 11:26 AM, Jose Mario Quintana <
[email protected]> wrote:
> Sure, the little puzzle, even after the spoiler, is not that easy :) ...
> Notice the smiley at the end of
> 'I am presenting myself by executing this sentence :)'
>
> There is no way the poor old untrusty linear representation (LR) ;) can
> faithfully represent WhoAmI for two reasons (another spoiler follows
> after a few blank lines):
>
>
>
>
>
>
>
>
>
>
>
>
> First, the Superbug is pestering the LR of certain embedded gerunds, for
> example,
>
> ^:(0:`(<'&'))
> ^:(0:`&)
>
> Last, but certainly not least, the LR is trying its best to deal with a
> noun that, arguably, should not be part of J's reality but fortunately it
> is. That is, a box containing a verb (in my mind this is the simplest way
> for a noun to represent a verb , adverb or conjunction; to recover the word
> just open the box); for example, if V is a box containing the verb *
> then,
>
> V
> ┌─┐
> │*│
> └─┘
> (5!:5)<'V'
> <*
>
> Later I will show how I produced the recurrent verb WhoAmI which is,
> giving the illusion of, taking arguments as a strand.
>
>
>
>
>
> On Thu, Mar 23, 2017 at 12:15 AM, 'Pascal Jasmin' via Programming <
> [email protected]> wrote:
>
>> get syntax error
>>
>>
>>
>>
>> ________________________________
>> From: Jose Mario Quintana <[email protected]>
>> To: "[email protected]" <[email protected]>
>> Sent: Wednesday, March 22, 2017 11:44 PM
>> Subject: Re: [Jprogramming] introducing j plus plus
>>
>>
>>
>> Thanks for the feedback Pascal. I just realized that I might have used
>> tacit anonymous continuations inadverterdly when I wrote, in Jx, the tacit
>> recurrent (aka multiple) adverbs sa and sna which can convert
>> adverbs taking arguments as a gerund into adverbs taking arguments as a
>> strand [0]. Incidentally, I have rewriten similar versions of
>> adverbs which run in official J interpreters but that should be a subject
>> for another thread in another time.
>>
>> In the meantime the following is a little puzzle in the same vain:
>>
>>
>> WhoAmI '' 'I am presenting myself by executing this sentence :)' ''
>> 'Spoiler coming in,' '' (,.|.i.33) '' (|.'...brev gnicudorper-fles eht
>> ma I') ''
>> I am presenting myself by executing this sentence :)
>> Spoiler coming in,
>> 32
>> 31
>> 30
>> 29
>> 28
>> 27
>> 26
>> 25
>> 24
>> 23
>> 22
>> 21
>> 20
>> 19
>> 18
>> 17
>> 16
>> 15
>> 14
>> 13
>> 12
>> 11
>> 10
>> 9
>> 8
>> 7
>> 6
>> 5
>> 4
>> 3
>> 2
>> 1
>> 0
>> I am the self-reproducing verb...
>> (<([ ,^:(0:`&) >)@:[ [ 0 0&$@(1!:2&2)@:])&(([ ,^:(0:`&) >)@:[ [ 0
>> 0&$@(1!:2&2)@:])
>>
>>
>> [0] [Jprogramming] Tacit recursion without $:
>>
>> *
>> http://www.jsoftware.com/pipermail/programming/2014-February/035416.html
>> <http://www.jsoftware.com/pipermail/programming/2014-February/035416.html
>> >*
>>
>>
>>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm