[Jprogramming] Verb to string and Verb array
Jan-Pieter Jacobs
janpieter.jacobs at gmail.com
Tue Apr 14 16:59:52 UTC 2015
Exactly. Actually, any time you want something to work as if it were
assigned to a name, you'd need brackets.
Eg: *: +&. won't work, while *: (+&.) will. But this might be out of your
scope, since +&. is an adverb, not a verb.
2015-04-14 17:35 GMT+02:00 Jon Hough <jghough at outlook.com>:
> Thanks,
> Just to be clear, '(',')',~ is just to bracketify the verb so its fork
> (in this case) works, right?
>
> --- Original Message ---
>
> From: "Jan-Pieter Jacobs" <janpieter.jacobs at gmail.com>
> Sent: April 14, 2015 5:26 PM
> To: programming at jsoftware.com
> Subject: Re: [Jprogramming] Verb to string and Verb array
>
> Hey John,
>
> I think 1. you can do using 5!:5:
>
> mean =: +/%#
> mean i.5
> 2
> 5!:5 <'mean'
> +/ % #
> datatype 5!:5 <'mean'
> literal
> ". (('(',')',~5!:5) <'mean'),'0 1 2 3 4'
> 2
> stringify =: '(',')',~5!:5
> (stringify <'mean') , '0 1 2 3 4'
> (+/ % #)0 1 2 3 4
>
> For point 2, you can use gerunds to pass around verbs in a list:
>
> ger =: +`-`*`%
> ger
> ┌─┬─┬─┬─┐
> │+│-│*│%│
> └─┴─┴─┴─┘
> 10 ((1{ger) `: 0) 20
> _10
>
> There's a massive amount of uses for gerunds, like / , ^: , } , and so
> on...
>
> If you'd want to do these things (make a noun (or list there of)) out of
> any type of word, I think you should be looking at atomic representation.
>
> Jan-Pieter
>
> 2015-04-14 10:11 GMT+02:00 Jon Hough <jghough at outlook.com>:
>
> > I have a couple of questions:
> > 1. Is it possible to convert a verb, e.g. +/%# , to a string?": '+/%# 2
> 3
> > 4' executes a stringed verb with an argument. But how would I convert a
> > verb to a string in the first place?
> > Also, I discovered the eval verb
> >
> >
> > eval=: 1 : 0
> >
> > ". 'w =. ' , u
> >
> > (ar < 'w') ab
> >
> > )
> >
> >
> > Does this have an inverse?
> >
> > 2. If I have two verbs (or conjunctions, adverbs for that matter), can I
> > not pass them around in a list?
> > e.g. in other languages, like C# I can put functions into a list
> > (List<Action> for example).
> > I searched JforC and the J website and couldn't find any way to do this.
> > Thanks Jon
> > ----------------------------------------------------------------------
> > 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
>
More information about the Programming
mailing list