Hi all!
I don't understand the meaning of "tacit adverb". Before parsing of the
actual tacit trains, all adverbs and conjunctions are tied to their
arguments? What remains is a verb train to be parsed? A verb train which
contains some built-in adverbs and conjunctions? These are tied to their
arguments under the hood? Remains a verb train composed to a single verb
which executes later?
All user-written adverbs and conjunctions are something similar to the
macros in assembler and C++?
Some of the built-in adverbs and conjunctions are compiled code with
verb arguments, I guess. There is no way I know of for users to add or
define such compiled adverbs and conjunctions.
There are external interfaces. You could call C/C++ code for example. I
don't know if it is possible for tacit code. I guess not.
What you do is to generate programs ? In runtime, when running tacit
code, there is only the same built in code? Except then for some added
functionality in Jx? But using explicit code, you can read user input
and generate programs? Like we used to do with Do(".) ? How would you
compare the methods you have with this traditional method to generate code?
Here my tacit conjunction AtTacit, equivalent with @:
AtTacit=: 2 : '[: u v'
The tacit code that actually executes is the second line, as far as i
understand. AtTacit only remains until I give it verb arguments, and
that will always happen before the actual tacit code is even parsed, as
far as I understand.
<AtTacit-
[: < -
Your t0 can be defined like this?
t0=: 1 : 'u + 1 % 1 + u'
u t0 t0
(u + 1 % 1 + u) + 1 % 1 + u + 1 % 1 + u
About the verb train. I know earlier there was a performance penalty for
writing -@:-@:-@:-@:- trains and you generated parenthesis, like this i
think: (-@:(-@:(-@:(-@:-)))). I can understand that. However this is no
longer necessary, since the performance difference is corrected. It was
also always possible to write strawmans([: - [:- [: - ]).
Now you use your o=: @: ?
*:`(+/)`-`j.`(^ %:)t1 1 2 3
2.40034j16.7123
(^ %:) o j. o - o (+/) o *: 1 2 3
2.40034j16.7123
The tacit executed code is the same? So it is about saving keypresses
and about visual impression?
*:`(+/)`-`j.`(^ %:)t1
(^ %:)@:j.@:-@:(+/)@:*:
(^ %:)o j.o-o(+/)o*:
(^ %:)@:j.@:-@:(+/)@:*:
I admire your work. I'm not critical. I just want to give you the
opportunity to explain it.
Cheers,
Erling Hellenäs
On 2017-10-21 20:13, Jose Mario Quintana wrote:
Indeed, one can produce many useful tacit adverbs by other means. However,
is there a general method to produce tacit adverbs using current official
interpreters? If worse comes to worse, the adverb hg provides the means do
to so for a vast class of adverbs (yet, there are still, at least, a couple
of cases which are not covered by hg; which ones?).
Often is not difficult to produce tacit adverbs acting on a verb and
produce sentences where there is only one instance of the verb. When the
argument appears more than once, it might not be not so clear. For
example, produce a tacit adverb t0 such that,
erase'u'
u t0
u + 1 % 1 + u
u t0 t0
(u + 1 % 1 + u) + 1 % 1 + u + 1 % 1 + u
] t0 t0 t0 t0 t0 t0 t0 ("0) 1 2 3 4
3.33943969 3.84748866 4.50703342 5.26330573
Yet, I know it can be produced, obeying the rules, via hg. However,
personally, I do not mind to break the rules when there are no adverse
consequences and I would simply write it, using the J Wicked Toolkit, in J
(or Jx) as,
t0=. [: u 'u + 1 % 1 + u' xi q adv
Another example is the one I mentioned in the first post: produce a tacit
adverb t1 such that,
u0`u1`u2`u3`u4`u5`u6 t1
u6@:u5@:u4@:u3@:u2@:u1@:u0
*:`(+/)`-`j.`(^ %:)t1 1 2 3
2.40034j16.7123
(
I just cannot resist mentioning, due to certain similarities, the following
page:
Trains: past, present and future
https://learnenglish.britishcouncil.org/en/magazine/trains-past-present-and-future
)
On Sat, Oct 21, 2017 at 8:25 AM, Erling Hellenäs <[email protected]>
wrote:
Hi all!
Since the full answers to these seemingly stupid questions are not clear
to me, I will pose them:
1. Why shouldn't we just write the adverbs and conjunctions instead of
producing them this way?
2. How does this way to do it compare to creating programs from strings
with Do(".) ?
".'f=: +'
1 f 1
2
".'f=: /'
+f 1 2 3
6
".'f=: @:'
+f- 1
_1
Cheers,
Erling Hellenäs
On 2017-10-21 13:34, Erling Hellenäs wrote:
After executing the modified script the examples in the post worked and I
could read it. /Erling
On 2017-10-21 12:32, Erling Hellenäs wrote:
Hi all!
I commented a printout that did not seem to work and modified the script
slightly while hopefully keeping its function.
9!:14''
o=. @:
ar=. 5!:1 @:<
a0=. `''
a1=. (@:[) ((<'&')`) (`:6)
a2=. (`(<(":0);_)) (`:6)
NB.(a0=. `'') (a1=. (@:[) ((<'&')`) (`:6)) (a2=. (`(<(":0);_)) (`:6))
((`'')(((@:[)(&`))(`:6)))((`_)(`:6))
av=. ((ar'a0')`) (`(ar'a1')) (`(ar'a2') ) (`:6)
NB. Adverbing a monadic verb (adv)
assert 1 4 9 -: 1 2 3 *: av
aw=. < o ((0;1;0)&{::) NB. Fetching the atomic representation
a3=. (@: (aw f.)) ('av'f.)
a4=. "_
a5=. `:6
a6=. ((( ar'a4') ; ] ; ( ar'a3')"_) ('av'f.)) (`:6)
hg=. `((ar'a6')`(ar'a5')) (`:6)
assert 1 4 9 -: 1 2 3 ((<'*:') ; ]) hg
erase'a0 a1 a2 a3 a4 a5 a6 ar av aw'
It then executed nicely.
Cheers,
Erling Hellenäs
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm