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' returning coname''
called as: 'a' put__dictinstance 0
chain.ijs: defines into locale z verbs that call dict instance methods, for
example:
put =: conjunction define
loc =. ": > y
". (":u),'put_',loc,'_ ',":v
)
this would allow something like:
d =: '' conew 'dict'
'b' put 1 'a' put__d 0
No?
Cheers,
Raoul
On Mon, Feb 7, 2022 at 1:02 AM Hauke Rehr <[email protected]> wrote:
> namespaces are a general need in programming
> objects orientation has its niches where it actually makes sense
>
> even Guido van Rossum’s extremist object oriented language says
>
> $>python
> Python 3.9.4 (default, Apr 16 2021, 23:37:41)
> [GCC 7.5.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import this
> The Zen of Python, by Tim Peters
>
> Beautiful is better than ugly.
> Explicit is better than implicit.
> Simple is better than complex.
> Complex is better than complicated.
> Flat is better than nested.
> Sparse is better than dense.
> Readability counts.
> Special cases aren't special enough to break the rules.
> Although practicality beats purity.
> Errors should never pass silently.
> Unless explicitly silenced.
> In the face of ambiguity, refuse the temptation to guess.
> There should be one-- and preferably only one --obvious way to do it.
> Although that way may not be obvious at first unless you're Dutch.
> Now is better than never.
> Although never is often better than *right* now.
> If the implementation is hard to explain, it's a bad idea.
> If the implementation is easy to explain, it may be a good idea.
> Namespaces are one honking great idea -- let's do more of those!
> >>>
>
> Objects aren’t mentioned at all.
> Namespaces are, and that statement is oh so true.
>
> Am 07.02.22 um 00:10 schrieb Raul Miller:
> > On Sun, Feb 6, 2022 at 4:34 PM 'Pascal Jasmin' via Programming
> > <[email protected]> wrote:
> >> J is poor at compound expressions that operate on an object.
> >
> > J's object model is about encapsulating administrative boundaries --
> > it was not designed to replace primitives. J's objects / locales allow
> > people to work while minimizing the need to contend with other people
> > on issues of namespace collisions.
> >
> > Objects for everything works, of course (see also: turing equivalence)
> > -- but it tends to be inefficient for many things (and have required
> > massive efforts to approach J's level of efficiency on arrays and
> > array operations).
> >
> > (Personally, I would much rather concern myself about physically
> > useful interfaces and mechanisms than focus on re-inventing a wheel
> > which has already been re-invented countless times.)
> >
> > That said, dictionaries with composable functions might eventually
> > lead to an object-like mechanism which could compete with locales.
> > And, I guess this was still an interesting observation.
> >
> > Thanks,
> >
>
> --
> ----------------------
> mail written using NEO
> neo-layout.org
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm