>  Using either of 3 :'... y' and {{...y}} fixes this.

The interpreter can also "fix" it for you although the answer might be
verbose and it is not tacit:

   (w@q)f.
({:`([: $: 0 1&+)@.(9&<@{.)@(([: */ "."0@":@{.) , {:)"1) (1 : 0)@(|:@,: 1:)
u y
:
x u y
)
   (w@q)f. 50 25 33 22 293
1 2 1 1 3

P.S. There was a way, using a previous-generation interpreter, to define an
illegal tacit adverb that could provide a desired context for $: to
maintain tacitness, alas that is no longer possible (as far as I know).



On Tue, Oct 17, 2023 at 7:25 PM 'Viktor Grigorov' via Programming <
programm...@jsoftware.com> wrote:
>
> The ( was a curtailed copy.
>
> I'd considered briefly $:'s context prior to thinking it shouldn't change
in either case, thinking it extended to the the parentheses around the
gerund, conjunction and verb. I didn't know the details of self-recurance's
scope. Using either of 3 :'... y' and {{...y}} fixes this.
>
> Thank you; sorry for the false alarm.
>
> Oct 18, 2023, 02:04 by rauldmil...@gmail.com:
>
> > This sentence gives me an error even without parens.
> >
> > Looking closer, I see six left parentheses and seven right parentheses
here:
> >
> >  ({:`([:$:0 1&+)@.(9&<@{.)@(([:*/"."0@":@{.),{:))"1(|:@,:1:))50 25 33
22 293
> >
> > Getting rid of the far right parenthesis gives me the result which you
> > displayed.
> >
> > Meanwhile, you're using $:
> >
> > And, incorporating (|:@,:1:) into the $: phrase changes the context of
> > $: which means that it also changes the definition used for evaluating
> > $: -- so you'll need to do something about that. There's several
> > possibilities, and using a name for the $: phrase is one of those.
> >
> > I hope this helps,
> >
> > --
> > Raul
> > On Tue, Oct 17, 2023 at 6:26 PM 'Viktor Grigorov' via Programming
> > <programm...@jsoftware.com> wrote:
> >
> >>
> >> Hey,
> >>
> >> I have a bit of code I want to include into something large, but I'm
hitting a wall.
> >>
> >>  ({:`([:$:0 1&+)@.(9&<@{.)@(([:*/"."0@":@{.),{:))"1(|:@,:1:))50 25 33
22 293
> >> 1 2 1 1 3
> >>
> >> Okay. Slap on some parens, and it fails? Valence error for {:..? Both
resolve to 3, a verb, according to 4!:0. Because both verbs are monadic, I
tried capping either and both, all composing conjunctions, parenthesizing.
Adding in ]. or [., I don't see what the problem is, or how tail's valence
fits into it? Some configurations increase the dimensions and don't give
out the desired thing:
> >>
> >>  (({:`([:$:0 1&+)@.(9&<@{.)@(([:*/"."0@":@{.),{:))"1 @ (|:@,:1:))50 25
33 22 293
> >> 1 0
> >> 0 0
> >>
> >> 1 1
> >> 0 0
> >>
> >> 1 0
> >> 0 0
> >>
> >> 1 0
> >> 0 0
> >>
> >> 1 1
> >> 1 0
> >>
> >> However, assigning both to names and composing does work
> >>
> >>  q=:|:@,:1:
> >>  w=:({:`([:$:0 1&+)@.(9&<@{.)@(([:*/"."0@":@{.),{:))"1
> >>  w q 50 25 33 22 293
> >> 1 2 1 1 3
> >>  (w@q)50 25 33 22 293
> >> 1 2 1 1 3
> >>
> >> What am I missing? This to me is unexpected behavior. I expect
parethesization and variable substitution to be identical, but it's not.
I'm sure there's a single, explanatory/exculpatory line somewhere about
assignments, variables and or parentheses on the wiki, but it's not easily
discoverable..
> >>
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to