Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread 'Pascal Jasmin' via Programming
Raul expressed by thinking,

.> x (f g n:A h) y  would be same as (f g h) n: A -> (x ((x f y) g (x h
y)) y)A

the logic is that g executes 3rd/last in (f g h), and f g(u@:) h) is same as (f 
g h)(u@:)

n: (A =: 1 : 'v m')is similar to (v@:) but applies to the result of the verb 
phrase u (applied to x,y) instead of the verb phrase u



On Friday, January 13, 2023 at 09:36:28 p.m. EST, Elijah Stone 
 wrote: 





Not quite (at least, not in my conception of it).  If it is to be useful in a 
larger verb train, you have to work out where exactly x and y come from.  For 
instance, if we have x (f g n:A h) y, should we apply (x f y) ((x f y) g (x h 
y))A (x h y)?  Or (x f y) (x g y)A (x h y)?  I say it should be chosen in the 
same way as $: (which leads to the latter in this case).

On Fri, 13 Jan 2023, Raul Miller wrote:

> I find it difficult to reason about this n:
>
> My best guess is that n: is itself an adverb and that u n: A (where u
> is a verb and A is an adverb) would be handled by special code which
> behaves like
>  {{ (u y) A}} : {{(x u y) A}}
>
> Does that agree with your thinking?
>
> Thanks,
>
> -- 
> Raul
>
> On Fri, Jan 13, 2023 at 7:38 PM 'Pascal Jasmin' via Programming
>  wrote:
>>
>> To answer Raul,  I did not use r2m after all.  oa through the magic of cloak 
>> allows 'Adverb' oa ('X' oa in example) where Adverb has a noun parameter.
>>
>> >  I had: u n: A y is (u y) A y.  Whereas you have u r2m A y as simply (u y) 
>> >A.
>>
>> if [x] u n: A y produced the result of x u y as input to A, then that is a 
>> legal way to get Adverb noun inputs from a verb phrase.  An adverb can 
>> create modifiers is the main benefit, and necessity for the functionality.
>>
>>
>> I feel that u n: A y as (u y) A y would be for producing verbs and noun 
>> results, and can be written as 1 : '(u y) A y' though that doesn't let you 
>> produce a conjunction from A and return (C y).
>>
>> If there is ever an attack on the supreme majesty that is Cloak, I do hope 
>> n: is implemented instead.
>>
>>
>> On Friday, January 13, 2023 at 05:39:30 p.m. EST, Elijah Stone 
>>  wrote:
>>
>>
>>
>>
>>
>> Oh, my n: is a little less expressive than your r2m.  I had: u n: A y is (u 
>> y)
>> A y.  Whereas you have u r2m A y as simply (u y) A.
>>
>> On Fri, 13 Jan 2023, Elijah Stone wrote:
>>
>> > I proposed your 'r2m' as a primitive n: (for 'now') a while ago, and 
>> > received
>> > a lukewarm response.  I don't think it can be implemented other than as a
>> > primitive.  (And I still think it would be a good idea to have.)
>> >
>> > Your solution which quotes the modifier name works, but I find it
>> > distasteful.
>> > And it has some trouble with conjunctions; how do you disambiguate the
>> > following?
>> >
>> > (u r2m) C v
>> >
>> > u C (v r2m)
>> >
>> > (u r2m) C (v r2m)
>> >
>> > You can't, so you would need a separate form for each.
>> >
>> > On Fri, 13 Jan 2023, 'Pascal Jasmin' via Programming wrote:
>> >
>> >> X =: 1 : 'm&+'
>> >>
>> >>
>> >> What definition of r2m (result to m argument) below would allow X to see
>> > the result of + y (or x+y) as its m argument?
>> >>
>> >> + r2m X 3
>> >>
>> >> purpose would be for X to produce a modifier from application of "verb".
>> > Requirement is only that y argument (3 above) is outside any verb phrase.
>> >>
>> >> Jose/Dan's Cloak magic? turn result into atomic or linear representation?
>> >> --
>> >> 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
--
For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread Elijah Stone
Not quite (at least, not in my conception of it).  If it is to be useful in a 
larger verb train, you have to work out where exactly x and y come from.  For 
instance, if we have x (f g n:A h) y, should we apply (x f y) ((x f y) g (x h 
y))A (x h y)?  Or (x f y) (x g y)A (x h y)?  I say it should be chosen in the 
same way as $: (which leads to the latter in this case).


On Fri, 13 Jan 2023, Raul Miller wrote:


I find it difficult to reason about this n:

My best guess is that n: is itself an adverb and that u n: A (where u
is a verb and A is an adverb) would be handled by special code which
behaves like
  {{ (u y) A}} : {{(x u y) A}}

Does that agree with your thinking?

Thanks,

--
Raul

On Fri, Jan 13, 2023 at 7:38 PM 'Pascal Jasmin' via Programming
 wrote:


To answer Raul,  I did not use r2m after all.  oa through the magic of cloak 
allows 'Adverb' oa ('X' oa in example) where Adverb has a noun parameter.

>  I had: u n: A y is (u y) A y.  Whereas you have u r2m A y as simply (u y) A.

if [x] u n: A y produced the result of x u y as input to A, then that is a 
legal way to get Adverb noun inputs from a verb phrase.  An adverb can create 
modifiers is the main benefit, and necessity for the functionality.


I feel that u n: A y as (u y) A y would be for producing verbs and noun 
results, and can be written as 1 : '(u y) A y' though that doesn't let you 
produce a conjunction from A and return (C y).

If there is ever an attack on the supreme majesty that is Cloak, I do hope n: 
is implemented instead.


On Friday, January 13, 2023 at 05:39:30 p.m. EST, Elijah Stone 
 wrote:





Oh, my n: is a little less expressive than your r2m.  I had: u n: A y is (u y)
A y.  Whereas you have u r2m A y as simply (u y) A.

On Fri, 13 Jan 2023, Elijah Stone wrote:

> I proposed your 'r2m' as a primitive n: (for 'now') a while ago, and received
> a lukewarm response.  I don't think it can be implemented other than as a
> primitive.  (And I still think it would be a good idea to have.)
>
> Your solution which quotes the modifier name works, but I find it
> distasteful.
> And it has some trouble with conjunctions; how do you disambiguate the
> following?
>
> (u r2m) C v
>
> u C (v r2m)
>
> (u r2m) C (v r2m)
>
> You can't, so you would need a separate form for each.
>
> On Fri, 13 Jan 2023, 'Pascal Jasmin' via Programming wrote:
>
>> X =: 1 : 'm&+'
>>
>>
>> What definition of r2m (result to m argument) below would allow X to see
> the result of + y (or x+y) as its m argument?
>>
>> + r2m X 3
>>
>> purpose would be for X to produce a modifier from application of "verb".
> Requirement is only that y argument (3 above) is outside any verb phrase.
>>
>> Jose/Dan's Cloak magic? turn result into atomic or linear representation?
>> --
>> 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

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread Raul Miller
I find it difficult to reason about this n:

My best guess is that n: is itself an adverb and that u n: A (where u
is a verb and A is an adverb) would be handled by special code which
behaves like
   {{ (u y) A}} : {{(x u y) A}}

Does that agree with your thinking?

Thanks,

-- 
Raul

On Fri, Jan 13, 2023 at 7:38 PM 'Pascal Jasmin' via Programming
 wrote:
>
> To answer Raul,  I did not use r2m after all.  oa through the magic of cloak 
> allows 'Adverb' oa ('X' oa in example) where Adverb has a noun parameter.
>
> >  I had: u n: A y is (u y) A y.  Whereas you have u r2m A y as simply (u y) 
> > A.
>
> if [x] u n: A y produced the result of x u y as input to A, then that is a 
> legal way to get Adverb noun inputs from a verb phrase.  An adverb can create 
> modifiers is the main benefit, and necessity for the functionality.
>
>
> I feel that u n: A y as (u y) A y would be for producing verbs and noun 
> results, and can be written as 1 : '(u y) A y' though that doesn't let you 
> produce a conjunction from A and return (C y).
>
> If there is ever an attack on the supreme majesty that is Cloak, I do hope n: 
> is implemented instead.
>
>
> On Friday, January 13, 2023 at 05:39:30 p.m. EST, Elijah Stone 
>  wrote:
>
>
>
>
>
> Oh, my n: is a little less expressive than your r2m.  I had: u n: A y is (u y)
> A y.  Whereas you have u r2m A y as simply (u y) A.
>
> On Fri, 13 Jan 2023, Elijah Stone wrote:
>
> > I proposed your 'r2m' as a primitive n: (for 'now') a while ago, and 
> > received
> > a lukewarm response.  I don't think it can be implemented other than as a
> > primitive.  (And I still think it would be a good idea to have.)
> >
> > Your solution which quotes the modifier name works, but I find it
> > distasteful.
> > And it has some trouble with conjunctions; how do you disambiguate the
> > following?
> >
> > (u r2m) C v
> >
> > u C (v r2m)
> >
> > (u r2m) C (v r2m)
> >
> > You can't, so you would need a separate form for each.
> >
> > On Fri, 13 Jan 2023, 'Pascal Jasmin' via Programming wrote:
> >
> >> X =: 1 : 'm&+'
> >>
> >>
> >> What definition of r2m (result to m argument) below would allow X to see
> > the result of + y (or x+y) as its m argument?
> >>
> >> + r2m X 3
> >>
> >> purpose would be for X to produce a modifier from application of "verb".
> > Requirement is only that y argument (3 above) is outside any verb phrase.
> >>
> >> Jose/Dan's Cloak magic? turn result into atomic or linear representation?
> >> --
> >> 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


Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread 'Pascal Jasmin' via Programming
To answer Raul,  I did not use r2m after all.  oa through the magic of cloak 
allows 'Adverb' oa ('X' oa in example) where Adverb has a noun parameter.

>  I had: u n: A y is (u y) A y.  Whereas you have u r2m A y as simply (u y) A.

if [x] u n: A y produced the result of x u y as input to A, then that is a 
legal way to get Adverb noun inputs from a verb phrase.  An adverb can create 
modifiers is the main benefit, and necessity for the functionality.  


I feel that u n: A y as (u y) A y would be for producing verbs and noun 
results, and can be written as 1 : '(u y) A y' though that doesn't let you 
produce a conjunction from A and return (C y).  

If there is ever an attack on the supreme majesty that is Cloak, I do hope n: 
is implemented instead.


On Friday, January 13, 2023 at 05:39:30 p.m. EST, Elijah Stone 
 wrote: 





Oh, my n: is a little less expressive than your r2m.  I had: u n: A y is (u y) 
A y.  Whereas you have u r2m A y as simply (u y) A.

On Fri, 13 Jan 2023, Elijah Stone wrote:

> I proposed your 'r2m' as a primitive n: (for 'now') a while ago, and received 
> a lukewarm response.  I don't think it can be implemented other than as a 
> primitive.  (And I still think it would be a good idea to have.)
>
> Your solution which quotes the modifier name works, but I find it 
> distasteful. 
> And it has some trouble with conjunctions; how do you disambiguate the 
> following?
>
> (u r2m) C v
>
> u C (v r2m)
>
> (u r2m) C (v r2m)
>
> You can't, so you would need a separate form for each.
>
> On Fri, 13 Jan 2023, 'Pascal Jasmin' via Programming wrote:
>
>> X =: 1 : 'm&+'
>>
>>
>> What definition of r2m (result to m argument) below would allow X to see 
> the result of + y (or x+y) as its m argument?
>>
>> + r2m X 3
>>
>> purpose would be for X to produce a modifier from application of "verb".  
> Requirement is only that y argument (3 above) is outside any verb phrase.
>>
>> Jose/Dan's Cloak magic? turn result into atomic or linear representation?
>> --
>> 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


[Jprogramming] Memory Mapped Files -> Shared Maps -> Syntax

2023-01-13 Thread Ak O
Hi Bill,

I am still getting this error:

 |Win sharename must not have/: assert
 | 'Win sharename must not have/' assert-. '/' e. sn


When I run both:
 map_jmf_ 'xxx';('fn' jpath 'C:\Users\user\map.jmf);('fn' jpath
'C:\Users\user\map.jmf);1
and
 share_jmf_ 'xxx';('fn' jpath 'C:\Useq

Am I thinking about this correctly?
I am try to produce a read-only (MTRO) view to a jmf file.


When I open 'jmf' and search:
  'Win sharename must'
, it takes me to line 310. (I think this is a convention check for Windows
setups. )

The Studio_Mapped_Files page says that it flips the '\' to '/':

 'If a sharename with \s is used ...the \s are replaced by /s.'


How do I make correct statements for both 'map_jmf_'
and 'share_jmf_', on a Windows system?

Thank you,


Ak
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] (A n) new train. was: more fun with parallelism

2023-01-13 Thread 'Pascal Jasmin' via Programming
The (A n) proposal is based on these performance considerations.

u P. 'attribute' returns u but sets as side effect "context of y" (and u if 
attribute is decorating the function) making the context available to u to 
determine action.

((P. 'attribute') n) ie. (A n) turns a y argument (noun n) into an Adverb that 
will add side effects "to context" from P.  but does nothing until u will be 
bound.

(C n) doesn't require any parser changes.  (A C n) is a useful new train, that 
allows for generic C

improvement over my previous post.

APPLY =: 2 : ' u n'  NB. works for monad
D =: 1 : '' NB. double adverb "that will look like" x u y call.  Avoids 
parentheses related mistakes of x"ranks instead of x&(u"ranks)

so with (A C n) train,

((P. 'attribute') APPLY n)  NB. will work as I want.  monad u required.

an alternative to doubleadverb D to turn dyad to monad is

(1 2 +"0 1 D  -: +"0 1(1 2&)) i.5
1

in terms of syntax, if attributes cannot have spaces, then multiple space 
separated attributes can be assigned at once.  perhaps a '-' prefix removes 
that attribute if it exists.  So, simplified code for P. using cut instead of 
the full features.

CONTEXT =: i.0
P =: 2 : ('CONTEXT =: ~. CONTEXT , cut n';'u')


ATTRIB =: 2 : '(P m) APPLY n'

'sorted' ATTRIB (i.5)

(P('sorted')) APPLY (0 1 2 3 4)


code dump I call attributes.ijs . Everything is 1 line with leading assignment 
if line wrap confusion.

CONTEXT =: i.0 NB. reset context. reload this file if you turn off any 
automatic reset operations.

D =: 1 : '' NB. double adverb "that will look like" x u y call. Avoids 
parentheses related mistakes of x"ranks instead of x&(u"ranks)

cutunboxed =: cut^:(0 = L.@]) NB. if y already boxed, leave alone.

G0 =: 0 {:: ]

G1 =: 1 {:: ]

Pdsl =: ([ ((}.each@G1) ~.@:-.~ (, G0)) (] ((#~ -.) ,&< #~) ('-' = 
{.)&>)@cutunboxed@])

P =: 2 : (' Pdsl wCONTEXT n';'u')

assignwithD =: 1 : '(x) =: x~ u y'

wCONTEXT =: assignwithD('CONTEXT'&) NB. u is dyad x is CONTEXT result assigned 
to CONTEXT


NB. side effect by code insert double adverb. double box for monad/dyad 
difference. list of single boxes for multiple line inserts. apply y =. [x] u y, 
do side effect/code insert, return new y

SE =: {{ 1 : ( ('y=. u y' (,) (, ]`(0 {::])@.(2 = L.) m) 
(,)'y'(,)':'(,)'y =. x u y'(,)(, ]`(1 {::])@.(2 
= L.) m)(,)'y'))}}

NB. 2 -('y =. +: y' ; 'y =. x,y') SE 4 NB. double result then prepend x. error 
if monad

NB. - ('y =. 0 , y' ,&<&< 'y =. x,y') SE 4 NB. double box monad/dyad cases. 
avoid error accessing x in monad.

NB. 3 : 'try. x=.x catch. x=.  end. y' 3 NB. alternative method to access x 
from monad without error. (so single boxed code insert)

preSE =: {{] [ 3 : m}}@] NB. returns y. m is explicit code that can access y. 
ambivalent verb result

APPLY =: 2 : ' u n' NB. works for monad

ATTRIB =: 2 : '(P m) APPLY n'

nATTRIB1 =: 1 : '(P (3 : ''CONTEXT'' a:) ) ATTRIB m' NB. MAKE "Decorated 
Adverb" from noun result assumes (change by filtering by DATAATTRIBUTES) 
CONTEXT only contains dataattributes

nATTRIB =: 'nATTRIB1' oa NB. if calculation result is to preserve adverb 
decorated noun

isNoun_z_ =: (0 = 4!:0 ( :: 0:))@:<

eval_z_ =: 1 : 'if. 2 ~: 3!:0 m do. m else. a: 1 : m end.' NB.1 : ' a: 1 : m'

aar =: 1 : 'if. isNoun ''u'' do. q =. m eval else. q =. u end. 5!:1 < ''q'' '

Cloak=: aar(0:`)(,^:)

oa =: 1 :'u Cloak @:' NB. apply quoted adverb after result. Can produce modifier


NB. fixed data attributes: 'sorted sortedD unique sortedbyitem sortedbyitemD 
uniquebyitem'

DATAATTRIBUTES =: 'sorted sortedD unique sortedbyitem sortedbyitemD 
uniquebyitem'

NB. monotonicI: sorted becomes sortedD (descending/inverted monotonic)

monotonicI =: (] [ ([ Pdsl (< '-monotonicI') , ('`' cut each cut 
'sortedD`-sorted sorted`-sortedD unique sortedbyitemD`-sortedbyitem 
sortedbyitem`-sortedbyitemD uniquebyitem') ;@#~ (cut 'sorted sortedD unique 
sortedbyitem sortedbyitemD uniquebyitem') e. [) wCONTEXT)

minus =: 3 : '(0 - ]) P ''monotonicI'' y': (4 : 'x - D P ''monotonicI'' y') 
(monotonicI@:)

iotaA =: 3 : 'i. P ''sorted sortedbyitem unique uniquebyitem'' y ' : (4 : 'x (+ 
i.) (P ''sorted sortedbyitem unique uniquebyitem'') y')

CONTEXT =: i.0 NB. P definitions pollute global CONTEXT

appologies for unused code.  SE not used or discussed until asked.  Highlights 
include Pdsl implements the cut and -prefix to delete syntax.  oa allows an 
adverb that takes noun input to chain from a verb phrase "result".  The code to 
clean up a monotonic (inverse) functions is pretty short compared to 8 case 
switch statement.

 2 iotaA 5  NB. sets CONTEXT to <;._1 ' sorted sortedbyitem unique uniquebyitem'

2 3 4 5 6

or can make an "adverb decorated" noun

 2 iotaA nATTRIB 5

(P(<;._1 ' sorted sortedbyitem unique uniquebyitem')) ATTRIB (2 3 4 5 6)

 2 minus 2 iotaA 5 NB. explicit minus version permits natural 
ambivalence.CONTEXT: <;._1 ' unique uniquebyitem sortedD sortedbyitemD'

0 _1 _2 _3 _4


choosing an adverb result

 2 minus nATTRIB 2 iotaA 

[Jprogramming] State machine add multiple words action

2023-01-13 Thread Pawel Jakubas
Oh, I see what I was missing. Column are character classes and rows are
arbitrary states that are not the same as the classes depicted in columns.
So I can have 10 states and 5 columns...

Thanks a lot!
Cheers,
Pawel
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread Elijah Stone
Oh, my n: is a little less expressive than your r2m.  I had: u n: A y is (u y) 
A y.  Whereas you have u r2m A y as simply (u y) A.


On Fri, 13 Jan 2023, Elijah Stone wrote:

I proposed your 'r2m' as a primitive n: (for 'now') a while ago, and received 
a lukewarm response.  I don't think it can be implemented other than as a 
primitive.  (And I still think it would be a good idea to have.)


Your solution which quotes the modifier name works, but I find it 
distasteful. 
And it has some trouble with conjunctions; how do you disambiguate the 
following?


(u r2m) C v

u C (v r2m)

(u r2m) C (v r2m)

You can't, so you would need a separate form for each.

On Fri, 13 Jan 2023, 'Pascal Jasmin' via Programming wrote:


X =: 1 : 'm&+'


What definition of r2m (result to m argument) below would allow X to see 

the result of + y (or x+y) as its m argument?


+ r2m X 3

purpose would be for X to produce a modifier from application of "verb".  

Requirement is only that y argument (3 above) is outside any verb phrase.


Jose/Dan's Cloak magic? turn result into atomic or linear representation?
--
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


Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread Elijah Stone
I proposed your 'r2m' as a primitive n: (for 'now') a while ago, and received 
a lukewarm response.  I don't think it can be implemented other than as a 
primitive.  (And I still think it would be a good idea to have.)


Your solution which quotes the modifier name works, but I find it distasteful. 
And it has some trouble with conjunctions; how do you disambiguate the 
following?


(u r2m) C v

u C (v r2m)

(u r2m) C (v r2m)

You can't, so you would need a separate form for each.

On Fri, 13 Jan 2023, 'Pascal Jasmin' via Programming wrote:


X =: 1 : 'm&+'


What definition of r2m (result to m argument) below would allow X to see the 
result of + y (or x+y) as its m argument?

+ r2m X 3

purpose would be for X to produce a modifier from application of "verb".  
Requirement is only that y argument (3 above) is outside any verb phrase.

Jose/Dan's Cloak magic? turn result into atomic or linear representation?
--
For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread Raul Miller
Near as I can see, none of this corresponds to + r2m {{m&+}} 3

-- 
Raul

On Fri, Jan 13, 2023 at 12:11 PM 'Pascal Jasmin' via Programming
 wrote:
>
> Cloak strikes again,
>
> isNoun_z_ =: (0 = 4!:0 ( :: 0:))@:<
> eval_z_ =: 1 : 'if. 2 ~: 3!:0 m do. m else. a: 1 : m end.' NB.1 : ' a: 1 : m'
> aar =: 1 : 'if. isNoun ''u'' do. q =. m eval else. q =. u end. 5!:1 < ''q'' '
> Cloak=: aar(0:`)(,^:)
> oa =: 1 :'u Cloak @:' NB. apply quoted adverb after result. Can produce 
> modifier
>
>
> + 'X' oa 32
>
> 32&+
>
> 2 (+ 'X' oa) 32
>
> 34&+
>
> 2 + ('X' oa) 32
>
> 34&+
>
>
>
>
>
> On Friday, January 13, 2023 at 11:19:49 a.m. EST, 'Pascal Jasmin' via 
> Programming  wrote:
>
>
>
>
>
> X =: 1 : 'm&+'
>
>
> What definition of r2m (result to m argument) below would allow X to see the 
> result of + y (or x+y) as its m argument?
>
> + r2m X 3
>
> purpose would be for X to produce a modifier from application of "verb".  
> Requirement is only that y argument (3 above) is outside any verb phrase.
>
> Jose/Dan's Cloak magic? turn result into atomic or linear representation?
> --
> 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


Re: [Jprogramming] State machine add multiple words action

2023-01-13 Thread Raul Miller
Here, I think we're talking about

M=: (a.=LF)+2*a.e.'0123456789'

S0=: +.".>cutLF {{)n
  1j1 2j1 1j1  NB. start here
  1j0 2j0 1j0  NB. non-newline
  1j0 1j2 1j0  NB. newline
}}

The columns correspond to character classes defined in M:  column 2 is
numbers, column 1 is line feeds, column 0 is everything else.

The rows correspond to state. Row 0 is the initial state (state 0).
Row 1 is the typical state after encountering the first character
(state 1). Row 2 is the typical state after encountering a new line
(state 2).

When in state 2, encountering a second newline emits the current word
and puts the machine at state 1, so state 1 which means that if there
were three newlines in a row we would not get a subsequent box
boundary for the third newline. A sequence of four newlines would
result in two boxes, each containing a pair of newlines.

I should have used more accurate comments. Perhaps:

S0=: +.".>cutLF {{)n
  1j1 2j1 1j1  NB. start here
  1j0 2j0 1j0  NB. typical state
  1j0 1j2 1j0  NB. single newline
}}

I hope  this makes sense,

-- 
Raul

On Fri, Jan 13, 2023 at 12:36 PM Pawel Jakubas  wrote:
>
> When looking at S0 as it it is used with M where 0 is other characters, 1
> is LF and 2 digits 
> I would expect rows to follow this and you have comments that seems not the
> case. For example the third row in S0 is
>
> 1j0 1j2 1j0  NB. newline
>
> I would expect it to represent digit. No?
>
> Also, when we take first row of S0
> 1j1 2j1 1j1  NB. start here
>
> The first element indicates that when being in "other characters"
> state the next one is "other character"
>
> then we transit to LF state without emission action but setting
> beginning of the next word. Shouldn't
>
> this setting be only after LF2 (LF -> LF)?
>
> Thanks!
>
> Pawel
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread Henry Rich
Verbs that produce non-noun results are interpreter bugs.  It is risky 
to assume that bugs will not be fixed.


Henry Rich

On 1/13/2023 11:56 AM, 'Pascal Jasmin' via Programming wrote:

Cloak strikes again,

isNoun_z_ =: (0 = 4!:0 ( :: 0:))@:<
eval_z_ =: 1 : 'if. 2 ~: 3!:0 m do. m else. a: 1 : m end.' NB.1 : ' a: 1 : m'
aar =: 1 : 'if. isNoun ''u'' do. q =. m eval else. q =. u end. 5!:1 < ''q'' '
Cloak=: aar(0:`)(,^:)
oa =: 1 :'u Cloak @:' NB. apply quoted adverb after result. Can produce modifier


     + 'X' oa 32

32&+

2 (+ 'X' oa) 32

34&+

2 + ('X' oa) 32

34&+





On Friday, January 13, 2023 at 11:19:49 a.m. EST, 'Pascal Jasmin' via Programming 
 wrote:





X =: 1 : 'm&+'


What definition of r2m (result to m argument) below would allow X to see the 
result of + y (or x+y) as its m argument?

+ r2m X 3

purpose would be for X to produce a modifier from application of "verb".  
Requirement is only that y argument (3 above) is outside any verb phrase.

Jose/Dan's Cloak magic? turn result into atomic or linear representation?
--
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


[Jprogramming] State machine add multiple words action

2023-01-13 Thread Pawel Jakubas
When looking at S0 as it it is used with M where 0 is other characters, 1
is LF and 2 digits 
I would expect rows to follow this and you have comments that seems not the
case. For example the third row in S0 is

1j0 1j2 1j0  NB. newline

I would expect it to represent digit. No?

Also, when we take first row of S0
1j1 2j1 1j1  NB. start here

The first element indicates that when being in "other characters"
state the next one is "other character"

then we transit to LF state without emission action but setting
beginning of the next word. Shouldn't

this setting be only after LF2 (LF -> LF)?

Thanks!

Pawel
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread 'Pascal Jasmin' via Programming
Cloak strikes again,

isNoun_z_ =: (0 = 4!:0 ( :: 0:))@:< 
eval_z_ =: 1 : 'if. 2 ~: 3!:0 m do. m else. a: 1 : m end.' NB.1 : ' a: 1 : m'
aar =: 1 : 'if. isNoun ''u'' do. q =. m eval else. q =. u end. 5!:1 < ''q'' '
Cloak=: aar(0:`)(,^:)
oa =: 1 :'u Cloak @:' NB. apply quoted adverb after result. Can produce modifier


    + 'X' oa 32

32&+

2 (+ 'X' oa) 32

34&+

2 + ('X' oa) 32

34&+





On Friday, January 13, 2023 at 11:19:49 a.m. EST, 'Pascal Jasmin' via 
Programming  wrote: 





X =: 1 : 'm&+'


What definition of r2m (result to m argument) below would allow X to see the 
result of + y (or x+y) as its m argument?

+ r2m X 3

purpose would be for X to produce a modifier from application of "verb".  
Requirement is only that y argument (3 above) is outside any verb phrase.

Jose/Dan's Cloak magic? turn result into atomic or linear representation?
--
For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread Raul Miller
Are you convinced that this would be viable?

Near as I can tell, for + r2m {{m&+}} 3 to be syntactically valid, r2m
must not be a conjunction. And the use of m here means that r2m cannot
be a verb. So r2m must be a noun (becoming the m in {{m&+}} which
prevents m from becoming the result of + y) or an adverb.

If r2m is an adverb, it's going to take + as an argument and produce a
result. If that result is anything other than a noun, the sentence
becomes a syntax error.

What am I missing here?

Thanks,

-- 
Raul

On Fri, Jan 13, 2023 at 11:19 AM 'Pascal Jasmin' via Programming
 wrote:
>
> X =: 1 : 'm&+'
>
>
> What definition of r2m (result to m argument) below would allow X to see the 
> result of + y (or x+y) as its m argument?
>
> + r2m X 3
>
> purpose would be for X to produce a modifier from application of "verb".  
> Requirement is only that y argument (3 above) is outside any verb phrase.
>
> Jose/Dan's Cloak magic? turn result into atomic or linear representation?
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] State machine add multiple words action

2023-01-13 Thread Raul Miller
In ijrd there's a constraint that j must be strictly less than i.

So you might try (0;s0;m0;1 0 0 1) ;: test1

Note that this will fail if the right argument to ;: is empty.

Was there anything else that you did not understand about my approach there?

Thanks,

-- 
Raul

On Fri, Jan 13, 2023 at 10:48 AM Pawel Jakubas  wrote:
>
> Thanks Raul.
>
> I realized I do not understand your S0, how you come up with it.
> Shouldn't it be just 2 state machine? And if so why the following does not
> work?
>test1=: {{)n
> 1000ddd
>   2000
> ab3000
>
> 1xxx
>
>11
>  22
> }}
>
>m0=: a.=LF
>
>s0=: +.".>cutLF {{)n
>   0j0 1j0NB. when r=0 and c=0 we do nothing, when r=0 and c=1 we do
> nothing but go to row=1
>   0j0 0j2NB. when r=1 and c=0 we do nothing and go to row=0, when next
> LF (row=1, col=1, we emit word with setting new beginning of new word and
> go to row=0
> }}
>
>(0;s0;m0;0 0 0 1);:test1
> |index error
> |   (0;s0;m0;0 0 0 1);:test1
>
> So we start with setting current word hence j=0 and we want final column
> d=0 to emit word.
>
> Do you see the shortcoming in the above snippet?
> thanks!
> cheers,
> Pawel
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm


[Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread 'Pascal Jasmin' via Programming
X =: 1 : 'm&+'


What definition of r2m (result to m argument) below would allow X to see the 
result of + y (or x+y) as its m argument?

+ r2m X 3

purpose would be for X to produce a modifier from application of "verb".  
Requirement is only that y argument (3 above) is outside any verb phrase.

Jose/Dan's Cloak magic? turn result into atomic or linear representation?
--
For information about J forums see http://www.jsoftware.com/forums.htm


[Jprogramming] State machine add multiple words action

2023-01-13 Thread Pawel Jakubas
Thanks Raul.

I realized I do not understand your S0, how you come up with it.
Shouldn't it be just 2 state machine? And if so why the following does not
work?
   test1=: {{)n
1000ddd
  2000
ab3000

1xxx

   11
 22
}}

   m0=: a.=LF

   s0=: +.".>cutLF {{)n
  0j0 1j0NB. when r=0 and c=0 we do nothing, when r=0 and c=1 we do
nothing but go to row=1
  0j0 0j2NB. when r=1 and c=0 we do nothing and go to row=0, when next
LF (row=1, col=1, we emit word with setting new beginning of new word and
go to row=0
}}

   (0;s0;m0;0 0 0 1);:test1
|index error
|   (0;s0;m0;0 0 0 1);:test1

So we start with setting current word hence j=0 and we want final column
d=0 to emit word.

Do you see the shortcoming in the above snippet?
thanks!
cheers,
Pawel
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Memory Mapped Files-> Shared Maps -> Syntax

2023-01-13 Thread bill lam
IIRC You may choose any share name need not the same as file name so long
as they contains no such special characters

On Fri, 13 Jan 2023 at 6:50 PM Ak O  wrote:

> I hope you are all well.
>
> I am trying to clarify the syntax for a shared map.
>
> When I try to execute:
>
>  map_jmf_ 'jdata';jdatafn;jdatafn;0NB. As the
> Studio_Mapped_Files.
>
> |Win sharename must not have /: assert
> | 'win sharename must not have /' assert-.'/'e.sn
>
>
> I am running Windows j-beta-i.
>
>
> Ak
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


[Jprogramming] Memory Mapped Files-> Shared Maps -> Syntax

2023-01-13 Thread Ak O
I hope you are all well.

I am trying to clarify the syntax for a shared map.

When I try to execute:

 map_jmf_ 'jdata';jdatafn;jdatafn;0NB. As the
Studio_Mapped_Files.

|Win sharename must not have /: assert
| 'win sharename must not have /' assert-.'/'e.sn


I am running Windows j-beta-i.


Ak
--
For information about J forums see http://www.jsoftware.com/forums.htm