Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: db module



> It would seem to me that all of this stuff can be accomplished by the
> equivalent of ksh discipline functions (plus, in the DB case, a module
> to do the actual database access).  Rather than implementing each of
> these things as different typeset variants, we should work on adding
> discipline functions.

So, if I grasp the concept correctly, one could do something like

db.get() { .sh.value=$(db_get thisdb "$.sh.subscript"); }
print $db[key]

> (Was it Andrej who's working on a parameter code rewerite?)

Oliver, I thought.  Maybe both of them.

> You mean "print $twice[2]", yes?

Yes.

> On Oct 6,  8:24am, Hans Dieter Pearcey wrote:
> } Subject: Re: db module
> }
> } However, if the function got an extra argument when an element was
> } assigned to, it could be pretty neat, e.g.:
> } 
> } f() { [ "$2" ] && echo $2 > $1; cat $1 }
> 
> I confess to having no idea what that's supposed to mean.

I think he's trying to say that var[5]=xyz would call $(f 5 xyz).
Only I don't know what the cat's about.

Using var.set() would seem much cleaner.



Messages sorted by: Reverse Date, Date, Thread, Author