[Jprogramming] Fwd: Adverb in parsing table

2023-06-10 Thread Raoul Schorer
Hello, When an adverb is executed, it should follow line 3 of the parsing table ( https://www.jsoftware.com/help/jforc/parsing_and_execution_ii.htm ). But: - How does the interpreter know if it should execute the 'monadic' vs. 'dyadic' adverb, e.g. 'infix' or 'table' in the case of '/' ?

Re: [Jprogramming] dictionary code released

2022-02-11 Thread Raoul Schorer
Cool! So, to follow up on my newbie assessment from a few days ago: How did you handle the problem of dict in dict? Maybe you've written that above, but explain like I'm 5 ;-) Cheers! Raoul Le ven. 11 févr. 2022 à 23:52, 'Pascal Jasmin' via Programming < programm...@jsoftware.com> a écrit : > h

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-02-07 Thread Raoul Schorer
Hi, Experienced users have discussed the impracticality of implementing dictionaries using a dataclass due to the calling convention implying string manipulation. I wish to submit the following idea for examination: dict.ijs: a dataclass, with private names 'key', 'val' and public method 'put' re

[Jprogramming] class method returning the instance

2022-02-01 Thread Raoul Schorer
Dear all, I'm following the J for C tutorial, and I'd like to know whether J allows methods to return the instance, i.e. 'this' in Java or 'self' in SmallTalk? Thanks! Raoul -- For information about J forums see http://www.jsoftw

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-02-01 Thread Raoul Schorer
I dug a little for an answer to Henry's first question: what's a dictionary? I found 2 things: 1. We're not the only ones who seem confused about this definition. 2. I found this: https://cs.stackexchange.com/a/30025/59926 that gives precise mathematical definitions, although still subject to deb

Re: [Jprogramming] Dictionaries WAS: Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Raoul Schorer
ity, down to the C layer. > > There are other good features of Python that J could copy, in > particular the 'dictionary' data type. The array language K has > dictionaries, so J might take some inspiration from there for > integrating them into the language. > > Cheers

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Raoul Schorer
Just my 2c, but I think that competing with python in general is somewhat delusional. I think the key point for expanding J use to have a "killer J app". For example, an improved clone of or excellent plugin for VisiData ( https://www.visidata.org/) is my idea of a killer app. But someone here may

[Jprogramming] debian package

2022-01-14 Thread Raoul Schorer
Hi, I noticed that j903 doesn't come as a Debian package (yet). The wiki link is dead. Is it in the works, or are debian users now advised to use the .zip? Best, Raoul -- For information about J forums see http://www.jsoftware.co

[Jprogramming] segregation boxing on bitvectors

2021-10-21 Thread Raoul Schorer
Hi, Really trivial question I am stuck on: given a bit vector 0 1 0 1 1 1 0 0 how to easily sequentially box 1s & 0s? Such as: |0|1|0|1 1 1|0 0| Thanks! Raoul -- For information about J forums see http://www.jsoftware.com/forum

Re: [Jprogramming] JAndroid sandboxed

2021-10-09 Thread Raoul Schorer
s). > > On Fri, Oct 8, 2021 at 9:44 PM bill lam wrote: > > > You can try using the open verb, eg > > > > open '..your file...' > > > > > > On Sat, Oct 9, 2021, 7:26 AM Raoul Schorer > > wrote: > > > > > Thank you Michael, >

Re: [Jprogramming] JAndroid sandboxed

2021-10-08 Thread Raoul Schorer
It doesn't prompt you but you > have to grant file access permissions > > On Fri, Oct 8, 2021, 17:27 Raoul Schorer wrote: > > > Dear all, > > > > I have a new Samsung tablet device, and after installing JAndroid I was > > surprised to see that the app is

[Jprogramming] JAndroid sandboxed

2021-10-08 Thread Raoul Schorer
Dear all, I have a new Samsung tablet device, and after installing JAndroid I was surprised to see that the app is completely sandboxed, i.e. can't edit any file above '~home'. Additionally, Samsung's Android forbids access to anything under '/Android/data' (where the JAndroid files including the

Re: [Jprogramming] Benchmarks

2021-10-05 Thread Raoul Schorer
Does that mean we could consider making the Y combinator part of the language as a library or primitive function? Speaking only for myself, I am very much in support of better recursion support in the language, since I usually draw my inspiration from Scheme programs. Cheers, Raoul Le mar. 5 oct

Re: [Jprogramming] can i trust `:0 to always execute left to right?

2021-09-30 Thread Raoul Schorer
I'm not a pro developer in any way, but my job entails some data analysis. Executing multiple verbs on the same data is something I do whenever I'm extracting distinct feature vectors or summary stats from raw data. Also, same thing when working on trees Hsu-style. I'd be sad to see :0 go! Just my

Re: [Jprogramming] New in beta-r: old stuff

2021-09-27 Thread Raoul Schorer
I am also very happy about the return of tacit modifiers. Everyone has their own particular reason to use J, and for me that's extreme terseness (I mostly write tiny research programs). Additionally, I think that having a choice of variation from terse to explicit is very nice to write short and c

Re: [Jprogramming] python3 addon bug?

2021-07-03 Thread Raoul Schorer
Sorry, I've been feeling under the weather since yesterday. Anyways: With vd in your path printf %"d\n" 1 2 3 4 5 | vd then 1. Shift+C: brings you to the 'columns sheet' 2. s: selects the 'text' column 3. g%: switches the 'text' column to float type 4. q: brings you back to the row sheet 5. z+: a

[Jprogramming] python3 addon bug?

2021-07-02 Thread Raoul Schorer
Hi, I'm attempting to use J in VisiData . When testing api/python3 with this program: import sys sys.path.append('/home/raoul/Desktop/j903/addons/api/python3') import jbase as jb import numpy as np jb.init(True) def j_mean(vals): jb.set('temp', np.array(v

Re: [Jprogramming] depth vector APL translation

2021-05-29 Thread Raoul Schorer
th computation (+/\-/'()'=/s) > > automatically places open parentheses one higher than closed ones. Some > > further discussion at > > https://mlochbaum.github.io/BQN/implementation/codfns.html . > > > > Marshall > > > > On Wed, May 26, 202

Re: [Jprogramming] depth vector APL translation

2021-05-25 Thread Raoul Schorer
^:_ y > }} > > There might be more efficient approaches? > > Thanks, > > -- > Raul > > On Mon, May 24, 2021 at 8:57 AM Raul Miller wrote: > > > > Oops > > > > dv=: 0, 1+ [:; [:dv&.> 1}.] > > > > > > Thanks, > > &

Re: [Jprogramming] depth vector APL translation

2021-05-24 Thread Raoul Schorer
Ethejiesa, I stand corrected! Your solution works. Thanks! On Mon, May 24, 2021 at 2:40 PM Raoul Schorer wrote: > Hi and thanks to all for helpting! > > Raul, I think you forgot to copy your working verb in your last. > Ethejiesa, good catch and great insight! Your verb yields a

Re: [Jprogramming] depth vector APL translation

2021-05-24 Thread Raoul Schorer
-+ > >dv ast > > 0 1 2 1 2 3 2 1 2 3 3 2 3 3 2 > > > (Apologies for any wonky formatting -- I am on a phone right now.) > > > Thanks, > > > -- > > Raul > > On Mon, May 24, 2021 at 2:47 AM ethiejiesa via Programming < > program

Re: [Jprogramming] depth vector APL translation

2021-05-23 Thread Raoul Schorer
ast > 1 2 2 2 3 3 2 1 2 2 2 2 2 2 1 > > We could treat the top level box as depth 0 easily enough > <: ;@(+L:0 L.)L:1^:_ L.L:0 ast > 0 1 1 1 2 2 1 0 1 1 1 1 1 1 0 > > But obviously that's still different from that "depth vector in record > format". > &

[Jprogramming] depth vector APL translation

2021-05-23 Thread Raoul Schorer
Dear all, I am struggling with the translation of the following APL dyad to J: ∊ 0 {(⊢,(⍺+1)∇⊣)/⌽⍺,1↓⍵} y which is the expression to yield a depth vector from a tree in record format (drawn from Dr. Hsu's thesis). Demo: t ← '∘' ast ← t (t t) (t (t t) t) (t (t t t) (t t t) t) ∊ 0 {(⊢,(⍺+1)∇⊣)/⌽⍺

Re: [Jprogramming] A new podcast on the Array Programming Languages

2021-05-20 Thread Raoul Schorer
Wow Bob, this first episode made it to the front page of HN ( https://news.ycombinator.com/item?id=27209093)! Congratulations! It would seem that many people are in fact interested in the array paradigm although the array community is rather silent online, usually. Looking forward to the next epi

Re: [Jprogramming] A new podcast on the Array Programming Languages

2021-05-16 Thread Raoul Schorer
This answer is bordering on incivility. On Sun, May 16, 2021 at 6:59 PM Hauke Rehr wrote: > Next up on this ad channel: > > Man without Modesty > a biographic movie about Bo Jacoby > > Am 16.05.21 um 13:26 schrieb 'Bo Jacoby' via Programming: > > Thank you for the podcast. I listened with pleasu

Re: [Jprogramming] GNU Scientific bindings?

2021-02-24 Thread Raoul Schorer
I am interested and willing. Not a software pro, though (never wrapped a C lib before). Not much bandwidth either. I guess I could maybe be of use on the J side. I hold an MSc in epidemiology, so I have a bit of stats knowledge too. I do all my epi dataset preparation in J, so I am very much in s

Re: [Jprogramming] Graphics package for drawing arbitrary figures

2021-02-18 Thread Raoul Schorer
>> Ian points out, SVG is compact and readable. > > >> >> > > >> >> Inkscape is not bad although the SVG's produced are not always > > optimal > > >> >> (but much quicker to develop than building by hand). > > >> >

Re: [Jprogramming] Graphics package for drawing arbitrary figures

2021-02-16 Thread Raoul Schorer
There is also graphics/fvj4 with the companion books, depending on what you're doing. Le mer. 17 févr. 2021 à 00:30, bill lam a écrit : > there is an addon demos/isigraph. > and IIRC there is also a lab for it. > > On Wed, Feb 17, 2021, 6:49 AM Devon McCormick wrote: > > > Thanks! This is exac

Re: [Jprogramming] duplicate jd table in current db

2021-02-03 Thread Raoul Schorer
Thanks Julian, "works" is all I need! Cheers, Raoul On Wed, Feb 3, 2021 at 11:53 PM Julian Fondren wrote: > I don't know if this is ideal, but it works: > >jd'read /table newts * from ts' > > On 2021-02-03 16:41, Raoul Schorer wrote: > > D

[Jprogramming] duplicate jd table in current db

2021-02-03 Thread Raoul Schorer
Dear all, I'd like to duplicate the 'ts' table in my 'db' database. The documentation and tutorial shows how to do this between two databases, but when I try: jd'tablecopy newts ts db' |Jd error: srcdb same as snkdb: op:tablecopy db:db user:u : jd_jd_ | 13!:8&3 t So, obviously it's not design

[Jprogramming] value error: wd

2021-01-25 Thread Raoul Schorer
Dear all, I am running on an up-to-date 902 from the terminal. I have done install 'full' as well as install 'all'. Calling wd yields a value error, so it seems wd is not available in my z locale. Directly calling (11!:0) 'qm' yields a domain error. Is it because I am running in the terminal? Is

Re: [Jprogramming] nested folds and scoping

2020-12-06 Thread Raoul Schorer
but it is tricky & > thus available only to those who have studied NuVoc down to the last > detail. > > Henry Rich > > On 12/5/2020 1:58 PM, Raoul Schorer wrote: > > Hi, > > > > I have a verb such as: > > > > v1 =: {{)m > > a=.L.y > >

[Jprogramming] nested folds and scoping

2020-12-05 Thread Raoul Schorer
Hi, I have a verb such as: v1 =: {{)m a=.L.y b=.2^1-~a c=. (http://www.jsoftware.com/forums.htm

Re: [Jprogramming] varying path length relation to tree

2020-09-19 Thread Raoul Schorer
ee any good reason to require that non-leaf nodes of the tree be rank > > zero. > > > > Also, this isn't going to be all that efficient -- but (if this is > > what you are looking for) there are some minor improvements available. > > > > Thanks, > > >

[Jprogramming] varying path length relation to tree

2020-09-19 Thread Raoul Schorer
Dear all, I am attempting to recover trees from a varying length path encoding. Chapter 32: Trees shows how to do it for fixed-length paths, but I wasn't able to find a suitable solution to the varying length case. To illustrate: leaves =. 'g';1 pa

Re: [Jprogramming] conditional application defined by bitmask

2020-08-16 Thread Raoul Schorer
eral monadic function, you can do as follows: > >desired_result -: bitmask 0&(] operator)"0 operand > 1 > > The basic idea is what the power operator does; m&v or v&m allows you to do > the same when the bitmask is an array and not a scalar. > > > >

[Jprogramming] conditional application defined by bitmask

2020-08-16 Thread Raoul Schorer
Hi, This seems pretty trivial, but I'm stuck on how to perform conditional application of a verb on a multidimensional array as defined by a bitmask of the same shape as the operand array. Is there a typical idiom for that? For example, operand =. 2 2 2 $ 3 2 2 3 2 3 3 2 bitmask =. 2 2 2 $ 1 0

Re: [Jprogramming] tacit syntax again

2020-07-09 Thread Raoul Schorer
Hi, Not at a J-capable keyboard, but NuVoc's documentation on '@.' is what you seem to be looking for. Cheers, Raoul Le jeu. 9 juil. 2020 à 11:26, Hauke Rehr a écrit : > Hello everybody, > > I wonder if there’s a simple way to “@:/“ a sequence of steps: > say I want to apply verbs a,b,c,d,e in

Re: [Jprogramming] Why does a simple amend give a rank error?

2020-06-22 Thread Raoul Schorer
Hi, ;: '999 9 } s' ┌─┬─┬─┐ │999 9│}│s│ └─┴─┴─┘ ;: '999 (9) } s' ┌───┬─┬─┬─┬─┬─┐ │999│(│9│)│}│s│ └───┴─┴─┴─┴─┴─┘ As demonstrated by using ;: above, the version without parentheses parses 999 9 as a single array. Cheers, Raoul Le lun. 22 juin 2020 à 20:33, HH PackRat a écrit :

[Jprogramming] reshaping a list to a table

2020-05-16 Thread Raoul Schorer
Hello, I am convinced that this must be trivial, but I wasn't able to find in the documentation how to reshape a list to a table without manually extracting the length. in summary, is there a more direct way of doing: lst =. i. 6 ((2,~2%~#) $ ]) lst for a list of arbitrary length? Thanks!

[Jprogramming] tree processing primitives

2020-05-10 Thread Raoul Schorer
Hello, After experimenting myself, I am in doubt regarding the type of tree traversal L: and S: provide. I am under the impression that the pattern is left pre-order traversal. Is that right, though? Thanks for your help, Raoul -

[Jprogramming] atomic vs. string representations

2020-05-03 Thread Raoul Schorer
Hi all, I have been comparing manually built identical phrases (a dyadic verb with its arguments) and executing it with ". or `:6. My understanding was that the advantage of atomic representation was that it bypassed parsing and that the execution model was: input string -> parsing -> atomic

Re: [Jprogramming] return from folds with chosen value

2020-03-02 Thread Raoul Schorer
Henry, Your solution indeed works as advertised. Thanks so much! Raoul -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jprogramming] return from folds with chosen value

2020-03-02 Thread Raoul Schorer
Dear all, I would like to know how to return from a fold, yielding a value that does not depend on the underlying sequence. Example: 0 (4 : '(x+y)') F:. ] i. 5 yields '0 1 3 6 10' using 0 (4 : '(x+y)[(_2 Z: 3=x)') F:. ] i. 5 stops the fold and returns '0 1 3' But I do not understand if/h

Re: [Jprogramming] fill atom woes

2020-02-21 Thread Raoul Schorer
specifically -- is the rule for associating a key within > y with the corresponding value within y? (This is probably obvious, > but it's worth stating because we're tripping over conflicts between > unstated assumptions.) > > Thanks, > > -- > Raul > > On Thu,

Re: [Jprogramming] fill atom woes

2020-02-20 Thread Raoul Schorer
Raul, I realise that my questions are somewhat awkward and I'm doing things that are way too complicated for me, but that's what I like about them so sorry if I was unclear. The requirement is that I would like to substitute members of x with those of y in a strict fashion, where x may be of

[Jprogramming] fill atom woes

2020-02-19 Thread Raoul Schorer
Hi, I have a 'find' dyadic verb that takes a (array of) integer(s), walks the associative array recursively and yields the current element when not found in the associative array, as below: var =: (4&=+.1&=)@(3!:0) find =:([`((]$:~]{::~2;<@[i.~1&{::@]) :: [)@.(var@[))"(0 _) Examples: (1 2)

[Jprogramming] How to flatten deeply nested arrays to a boxed vector?

2020-02-13 Thread Raoul Schorer
Dear all, I would like to know what is the best way to flatten a deeply nested array to a single level of boxing. Essentially: (0 ;<(1;'a');<(2;<<'b')),:|.(3 ;<(4;'c');<(5;<<'d')) would yield 0;1;2;3;4;5;'a';'b';'c';'d' where order is unimportant. Thanks! Raoul ---

[Jprogramming] Logic programming

2020-02-03 Thread Raoul Schorer
Hi, I've been working hard implementing minikanren in J. It's a minimal logic language that at the difference of prolog is purely relational and very well suited to a library due to its shallow embedding. The lib currently can compute on lazy "streams" and does conjunction, disjunction and syntac

[Jprogramming] higher-order function

2020-01-30 Thread Raoul Schorer
Hi, I wrote a dyadic conjunction, that I call as: x u conj v y, where x u v y are all nouns However, I get the error "noun result was required". My conjunction actually yields a "suspended function" (thunk) in the form of a string wrapped in the "_ verb, as in ('recursive_function')"_ I have two

[Jprogramming] procedure test and delayed eval

2020-01-16 Thread Raoul Schorer
Hi, I am translating scheme code that makes heavy use of delayed evaluation (thunks). In scheme, there is a predicate 'procedure?' that returns a boolean. I translated that into a check for a boxed string, which is the representation I use for delayed procedures, which I then 'force' using ".@>

Re: [Jprogramming] lazy evaluation on infinite streams

2020-01-08 Thread Raoul Schorer
es you'd use an anonymous closure for the second member > of the pair, and an eager language that had some support for 'lazy > lists' might have some lazy/force syntax that's closures under the > hood. > > On Wed, 2020-01-08 at 02:24 +0100, Raoul Schorer wrote: > &

Re: [Jprogramming] lazy evaluation on infinite streams

2020-01-07 Thread Raoul Schorer
r. 8 janv. 2020 à 01:56, Henry Rich a écrit : > I don't understand the task at all. You might look in NuVoc for $:, F. > etc., and M. > > Henry Rich > > On 1/7/2020 7:51 PM, Raoul Schorer wrote: > > Hi, > > > > Implementing Minikanren <http://minikanre

[Jprogramming] lazy evaluation on infinite streams

2020-01-07 Thread Raoul Schorer
llowing the lazy evaluation of this infinite "stream". Is switching to iterative/eager eval the only realistic way? Can someone help me with lazy eval of infinite structures in J, or give me pointers to resources on the topic? Thanks! Raoul Schorer -

Re: [Jprogramming] jandroid 901 plot crashes

2020-01-01 Thread Raoul Schorer
Hi, For the record, I also get the same error for all 'jpkg' commands: load'pacman' 'update'jpkg'' Updating server catalog... |limit error: fixzips | siz=.0".(ndx+1)}.&>fls JVERSION Engine: j901/j32/android Release-a: commercial/2019-12-21T13:06:35 Library: 9.01.18 J Android: 1.4.00/8

Re: [Jprogramming] translating scheme code

2019-12-29 Thread Raoul Schorer
oblique references and > journal of abnormal psychology pages... > > Thanks, > > -- > Raul > > On Sat, Dec 28, 2019 at 8:51 PM Raoul Schorer > wrote: > > > Hi, > > > > I am trying to implement minikanren <http://www.minikanren.org> in J.

Re: [Jprogramming] translating scheme code

2019-12-29 Thread Raoul Schorer
y. Is that possible? Raoul On Sun, Dec 29, 2019 at 3:15 AM Henry Rich wrote: > I would like to help, but I don't get what is called for. Maybe there > are Scheme users who will pipe up. > > If not, can you describe what the desired input and output are? > > Henry Rich

[Jprogramming] translating scheme code

2019-12-28 Thread Raoul Schorer
Hi, I am trying to implement minikanren in J. I have it almost working, but I am stuck in the last part of the core implementation . I do not understand how to write "call/fresh" from the scheme cod

[Jprogramming] trivial value passing issue

2018-03-02 Thread raoul schorer
Dear all, I am learning J and stumbled on something today: I loaded a .csv and obtained a boxed table, that I assigned to the name 'data'. The first row of 'data' looks like that: │N°IPP│Nom du paramètre│Valeur│Valeur Unit│Heure│ Then I defined two functions, that do work as expected: NB.