Re: [Jprogramming] 0!:0 and private namespaces

2020-09-09 Thread Raul Miller
Yes, the big differences between 0!:0 and ". on unboxed arguments are: ". returns the noun result from the execution if there is one, 0!:0 always returns $~0 0 ". requires a single sentence, 0!:0 allows newlines (and so can handle multiple sentences including :0 definitions). Thanks, -- Raul

Re: [Jprogramming] 0!:0 and private namespaces

2020-09-08 Thread ethiejiesa via Programming
Oh! Duh. I was confused. (0!:0) directly executes the string (or file). Much clearer now. Thank you. Raul Miller wrote: >example=: 3 :'echo 1' >0!:0'example' >0!:0'example 0' > 1 > > Put different: when you evaluate a bare name which references a verb, > the result of that execution

Re: [Jprogramming] 0!:0 and private namespaces

2020-09-08 Thread Raul Miller
example=: 3 :'echo 1' 0!:0'example' 0!:0'example 0' 1 Put different: when you evaluate a bare name which references a verb, the result of that execution is the named verb. You have to give the verb an argument to execute it. Also: a=. 3 0!:0'a' a 3 0!:0'a=. 4' a (But, al

[Jprogramming] 0!:0 and private namespaces

2020-09-08 Thread ethiejiesa via Programming
Say we have a file ~home/script.jis with the following contents: a=. 'bar' and start a J session: a=. 'foo' verb=. 0 :0 a=. 'baz' ) a foo 0!:0 http://www.jsoftware.com/forums.htm

Re: [Jprogramming] 0 % 0

2019-05-27 Thread Jimmy Gauvin
Hi, you can start with this excellent article by Eugene McDonnell : https://www.jsoftware.com/papers/eem/0div0a.htm Jimmy On Mon, May 27, 2019 at 3:16 PM Eugene Nonko wrote: > Hello, > > Can someone please explain this: > >0 % 0 > > 0 > > Thanks, > Eugene >

Re: [Jprogramming] 0 % 0

2019-05-27 Thread Brian Schott
In addition, to Roger's link, these are similar. https://www.jsoftware.com/papers/zero.htm http://www.jsoftware.com/pipermail/general/2003-January/013868.html [the latter contains a dead link, which I think is the former]N -- For

Re: [Jprogramming] 0 % 0

2019-05-27 Thread Roger Hui
Eugene, funny that you should ask, because _the_ explanation can be found in https://www.jsoftware.com/papers/eem/0div0.htm . On Mon, May 27, 2019 at 12:16 PM Eugene Nonko wrote: > Hello, > > Can someone please explain this: > >0 % 0 > > 0 > > Thanks, > Eugene > ---

[Jprogramming] 0 % 0

2019-05-27 Thread Eugene Nonko
Hello, Can someone please explain this: 0 % 0 0 Thanks, Eugene -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] 0 : 0 Adverb

2014-03-18 Thread Pascal Jasmin
Subject: Re: [Jprogramming] 0 : 0 Adverb Since you'd want to have the verb as return value, you'd want to have an adverb or conjunction. They both need operands to do a job. I tried this with } instead of Tacify, but I guess it will just work as well: >    foo =: (0 :) } > >   

Re: [Jprogramming] 0 : 0 Adverb

2014-03-18 Thread Henry Rich
No way to have a single word, since a single word is just a value and is not executed. And I can't find a way to do it on 2 words when one is an adverb. Henry Rich On 3/18/2014 8:42 AM, Pascal Jasmin wrote: from http://www.jsoftware.com/jwiki/PascalJasmin/Multiline%20tacit%20expressions%20wi

Re: [Jprogramming] 0 : 0 Adverb

2014-03-18 Thread Jan-Pieter Jacobs
Since you'd want to have the verb as return value, you'd want to have an adverb or conjunction. They both need operands to do a job. I tried this with } instead of Tacify, but I guess it will just work as well: >foo =: (0 :) } > >0 foo >123 >) >(49 50 51 10{a.)} I think this should equal

[Jprogramming] 0 : 0 Adverb

2014-03-18 Thread Pascal Jasmin
from  http://www.jsoftware.com/jwiki/PascalJasmin/Multiline%20tacit%20expressions%20with%20macros test =: 0 : 0 Tacify ( +/ x % y 13 MACdef NB.macro that will call 13 : x % y and return % #) NB. blank line with comment next without comment @:> ) produces +/ % #)@:> and is