Thanks all for responding to my tangent in this thread.
I will give all the suggestions more study and see if they do in fact
already meet my needs.​

Cheers,
Alex

On Fri, Nov 24, 2017 at 12:29 AM, Raul Miller <[email protected]> wrote:

> The 'do' verb is one of a variety of tools for building and using
> executable J dynamically at run time. (Which can be valuable for
> development and testing tools.)
>
> Other ways include:
>
> * the explicit conjunction ( : )
> * gerunds
> * 0!:n
> * 128!:2
>
> Also, worth considering, in this context, are locales (which can serve
> as objects, classes, stack frames, and so on) and/or indirect
> assignment ( (leftexpression)=: rightexpression ) and/or the debugging
> tools ( 13!:n ).
>
> Thanks,
>
> --
> Raul
>
>
>
> On Thu, Nov 23, 2017 at 11:01 PM, Erling Hellenäs
> <[email protected]> wrote:
> > Hi all!
> >
> > Another way to do the same thing. This function reads an explicit
> function
> > definition from terminal input.
> >
> >    Scan =: 3 : 0
> > a=.1!:1 [1
> > ". a
> > f/\y
> > )
> >    Scan 2 3 4
> > f=.4 : 'x*y'
> > 2 6 24
> >
> > I just use terminal input to demonstrate that this really happens at
> what we
> > can feel is runtime. It means you can manipulate ascii data at runtime
> and
> > produce functions which you then execute, and which can be input to other
> > already-defined functions.
> > I guess using Do(".) is the 'normal' way to do it in explicit code.
> >
> > Cheers,
> > Erling Hellenäs
> >
> >
> >
> > On 2017-11-23 16:25, Erling Hellenäs wrote:
> >>
> >> Hi all!
> >>
> >>
> >> https://en.wikipedia.org/wiki/Scope_(computer_science)#Lexic
> al_scope_vs._dynamic_scope
> >>
> >>    AddScan =: 3 : 0
> >> add=.4 : 'x + y'
> >> add/\y
> >> )
> >>    AddScan 2 3 4
> >> 2 5 9
> >>
> >> I don't understand how your example shows lexically scoped functions,
> but
> >> as far as I understand, "add" in the example above is an explicit
> definition
> >> of a lexically scoped function.
> >>
> >> I don't think functions are first class citizens in J according to this
> >> definition. https://en.wikipedia.org/wiki/First-class_citizen
> >>
> >> Functions can not return functions. They can take functions as
> arguments,
> >> but resolution is normally done in some pre-interpretation stage, like
> with
> >> macros in other languages.
> >>
> >> There are ways in explicit code to establish functions from from ascii
> >> representation in runtime. Here is an example:
> >>
> >>     Scan =: 3 : 0
> >> a=.1!:1 [1
> >> f=. a 5!:0
> >> f/\y
> >> )
> >>    Scan 2 3 4
> >> *
> >> 2 6 24
> >>    Scan 2 3 4
> >> +
> >> 2 5 9
> >>
> >> This function establishes a function from terminal ascii input.
> >>
> >> So, with explicit code you can manipulate ascii representations of
> >> functions and create new functions at what is similar to "runtime". You
> can
> >> pass these ascii representations as variables. The functions you create
> can
> >> be used as parameters to functions, as the example shows.
> >>
> >> Cheers,
> >>
> >> Erling Hellenäs
> >>
> >> Den 2017-11-21 kl. 19:56, skrev Alex Shroyer:
> >>>
> >>> @AndrewD: I've been using J casually for about 2 years, and consider
> >>> myself
> >>> an "intermediate beginner".  I also use Python, and my impression is
> that
> >>> Python makes it easy to see what the author *wanted* the program to do,
> >>> but
> >>> J makes it easier to see what the program *actually does*.
> >>>
> >>> However, one frustration I still have is regarding explicit
> definitions.
> >>> IMO they should be replaced with something more like what the K
> language
> >>> provides, namely first-class, lexically-scoped functions:
> >>>
> >>>     add: {x+y}
> >>>     scan: {x\y}
> >>>     scan [add; 2 3 4]
> >>> 2 5 9
> >>>
> >>> Perhaps J's syntax could be extended someday, to recognize this type of
> >>> function in an explicit definition, for example:
> >>>
> >>>     add =: dyad def 'x+y'
> >>>     scan =: HOF def 'x\y'  NB. in this scheme, HOF stands for
> >>> 'higher-order
> >>> function' and tells interpreter to not evaluate x or y until both
> >>> arguments
> >>> are bound
> >>>     add scan 2 3 4
> >>> 2 5 9
> >>>
> >>> There are a few other things I'd like J to take from K, but that's the
> >>> big
> >>> one.
> >>>
> >>> On Mon, Nov 20, 2017 at 11:16 AM, chris burke <[email protected]>
> >>> wrote:
> >>>
> >>>> Dear All
> >>>>
> >>>> My attempt to move this thread over to programming failed, but please
> >>>> note
> >>>> for future use that discussions like this on the language are much
> >>>> better
> >>>> addressed to the programming forum. Not least, they will then reach
> all
> >>>> J
> >>>> forum readers, not just those subscribed to general. See http://code.
> >>>> jsoftware.com/wiki/System/Forums .
> >>>>
> >>>> Thanks.
> >>>>
> >>>> Chris
> >>>> ------------------------------------------------------------
> ----------
> >>>> For information about J forums see http://www.jsoftware.com/forum
> s.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
> ----------------------------------------------------------------------
> 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