Preexecuting verbs with (( ))

14 views
Skip to first unread message

Don Guinn

unread,
Jul 5, 2026, 9:49:00 AM (2 days ago) Jul 5
to fo...@jsoftware.com
In looking at "Special Combinations" it covers enclosing in double parens. ttest works as expected, but shouldn't explicit definition return the same result as the tacit definition?

a =: 'This is a'

b =: 'this is b'

test =: {{

((a;b)),<y

}}

ttest =: a;b;]

a =: 'a is updated'

b =: 'b is updated'

echo test 'Explicit'

┌────────────┬────────────┬────────┐

│a is updated│b is updated│Explicit│

└────────────┴────────────┴────────┘

echo ttest 'Tacit'

┌─────────┬─────────┬─────┐

│This is a│this is b│Tacit│

└─────────┴─────────┴─────┘

Henry Rich

unread,
Jul 5, 2026, 10:06:19 AM (2 days ago) Jul 5
to fo...@jsoftware.com
No.  In the explicit form, there is no preexecution because a and b are names.  Execution must be deferred until the value of the name is known.

/Nameless/ parenthesized sequences are executed at definition time, but only if they do not involve any verb executions: (+/ % #) but not (i. 100000000).  The double parens allow execution of verbs (again with no names).

In the tacit form, the /values/ of a and b are stacked when the verb is defined, and those anonymous values are frozen into ttest.

Henry Rich
To unsubscribe from this group and stop receiving emails from it, send an email to forum+un...@jsoftware.com.

Don Guinn

unread,
Jul 5, 2026, 10:21:10 AM (2 days ago) Jul 5
to fo...@jsoftware.com
From "special combinations"

If you enclose a fragment in double parentheses, it will be pre-parsed even if it executes verbs, provided it meets the other requirements for PPPP. An example:

a =. (('Name';'Value')) , table

The table header will be computed at definition time rather than at execution time.

I can't find what "definition time" means. How can the above example of "a" ever be made at "definition time" without executing when the statement is entered other than in an explicit or direct definition?

Henry Rich

unread,
Jul 5, 2026, 10:55:34 AM (2 days ago) Jul 5
to fo...@jsoftware.com
I have rewritten the Wiki section.  Please read again starting at 'Creation of an explicit entity'.

In your example, what is preexecuted is

   (('Name';'Value'))

Executing this involves allocating a result of (;), copying the addresses of the strings, incrementing the usecounts of the strings, and eventually undoing all that.

Because of the (( )), this will be done once, when the entity is created, and undone when the entity is deleted.  
In the internal form of the entity, the parenthesized phrase is replaced by a pointer to the two-element boxed list.

Henry Rich

Raul Miller

unread,
11:36 AM (6 hours ago) 11:36 AM
to fo...@jsoftware.com
In my testing, these both produce a syntax error:
('Name';'Value'),table
(('Name';'Value')),table

Because (table) is an adverb.

That said, I think an illustrating example would be worthwhile. But to
illustrate the point the example should probably include time and
space measurements for the definition and its use. (Perhaps this would
be a useful context for the Ackerman function?)

Thanks,

--
Raul

Henry Rich

unread,
11:41 AM (6 hours ago) 11:41 AM
to fo...@jsoftware.com
I didn't know that.

Feel free to improve the Wiki.  It would be unusual for ((...)) to make
a material difference, but possible.

hhr
Reply all
Reply to author
Forward
0 new messages