Leaf Attribute Functions

Functions for use with leaf nodes in PennMUSH attribute trees.

Category: Functions
Commands: @create, @dolist, @lock, @set.
Features: #lambda.
Compatibility: PennMUSH.

Instructions

Copy and paste the below code into a compatible MUSH or MUX.

MUSHCode for Leaf Attribute Functions

@create Leaf Attribute Functions
@lock Leaf Attribute Functions==me
@set Leaf Attribute Functions = !NO_COMMAND
@set Leaf Attribute Functions = MISTRUST
&CREDIT Leaf Attribute Functions=spork @ funview.pennmush.org
&PFUN Leaf Attribute Functions=
&PFUN`LLATTR Leaf Attribute Functions=objeval(%@,remove(setr(l,lattr(first(%0,/)/[strfirstof(rest(%0,/),**)],setr(o,strfirstof(%1,%b)))),filterbool(#lambda/strlen\(grab\(%ql\,\%0`*\)\),%ql,%qo),%qo))
@set Leaf Attribute Functions/PFUN`LLATTR=public
&PFUN`LLATTR`MAX Leaf Attribute Functions=2
&PFUN`LLATTR`MIN Leaf Attribute Functions=1
&PFUN`LLATTRP Leaf Attribute Functions=objeval(%@,remove(setr(l,lattrp(first(%0,/)/[strfirstof(rest(%0,/),**)],setr(o,strfirstof(%1,%b)))),filterbool(#lambda/strlen\(grab\(%ql\,\%0`*\)\),%ql,%qo),%qo))
&PFUN`LLATTRP`MAX Leaf Attribute Functions=2
&PFUN`LLATTRP`MIN Leaf Attribute Functions=1
&PFUN`NLATTR Leaf Attribute Functions=objeval(%@,words(remove(setr(l,lattr(first(%0,/)/[strfirstof(rest(%0,/),**)])),filterbool(#lambda/strlen\(grab\(%ql\,\%0`*\)\),%ql))))
&PFUN`NLATTR`MAX Leaf Attribute Functions=1
&PFUN`NLATTR`MIN Leaf Attribute Functions=1
&PFUN`NLATTRP Leaf Attribute Functions=objeval(%@,words(remove(setr(l,lattrp(first(%0,/)/[strfirstof(rest(%0,/),**)])),filterbool(#lambda/strlen\(grab\(%ql\,\%0`*\)\),%ql))))
&PFUN`NLATTRP`MAX Leaf Attribute Functions=1
&PFUN`NLATTRP`MIN Leaf Attribute Functions=1
&PFUN`REGLLATTR Leaf Attribute Functions=objeval(%@,remove(setr(l,reglattr(first(%0,/)/[strfirstof(rest(%0,/),.+)],setr(o,strfirstof(%1,%b)))),filterbool(#lambda/strlen\(grab\(%ql\,\%0`*\)\),%ql,%qo),%qo))
&PFUN`REGLLATTR`MAX Leaf Attribute Functions=2
&PFUN`REGLLATTRP Leaf Attribute Functions=objeval(%@,remove(setr(l,reglattrp(first(%0,/)/[strfirstof(rest(%0,/),.+)],setr(o,strfirstof(%1,%b)))),filterbool(#lambda/strlen\(grab\(%ql\,\%0`*\)\),%ql,%qo),%qo))
&PFUN`REGLLATTRP`MAX Leaf Attribute Functions=2
&PFUN`REGNLATTR Leaf Attribute Functions=objeval(%@,words(remove(setr(l,reglattr(first(%0,/)/[strfirstof(rest(%0,/),.+)])),filterbool(#lambda/strlen\(grab\(%ql\,\%0`*\)\),%ql))))
&PFUN`REGNLATTR`MAX Leaf Attribute Functions=1
&PFUN`REGNLATTR`MIN Leaf Attribute Functions=1
&PFUN`REGNLATTRP Leaf Attribute Functions=objeval(%@,words(remove(setr(l,reglattrp(first(%0,/)/[strfirstof(rest(%0,/),.+)])),filterbool(#lambda/strlen\(grab\(%ql\,\%0`*\)\),%ql))))
&PFUN`REGNLATTRP`MAX Leaf Attribute Functions=1
&PFUN`REGNLATTRP`MIN Leaf Attribute Functions=1
&PFUN`REGXLATTR Leaf Attribute Functions=objeval(%@,elements(remove(setr(l,reglattr(first(%0,/)/[strfirstof(rest(%0,/),.+)])),filterbool(#lambda/strlen\(grab\(%ql\,\%0`*\)\),%ql)),lnum(%1,%2), ,strfirstof(%3,%b)))
&PFUN`REGXLATTR`MAX Leaf Attribute Functions=4
&PFUN`REGXLATTR`MIN Leaf Attribute Functions=3
&PFUN`REGXLATTRP Leaf Attribute Functions=objeval(%@,elements(remove(setr(l,reglattrp(first(%0,/)/[strfirstof(rest(%0,/),.+)])),filterbool(#lambda/strlen\(grab\(%ql\,\%0`*\)\),%ql)),lnum(%1,%2), ,strfirstof(%3,%b)))
&PFUN`REGXLATTRP`MAX Leaf Attribute Functions=4
&PFUN`REGXLATTRP`MIN Leaf Attribute Functions=3
&PFUN`XLATTR Leaf Attribute Functions=objeval(%@,elements(remove(setr(l,lattr(first(%0,/)/[strfirstof(rest(%0,/),**)])),filterbool(#lambda/strlen\(grab\(%ql\,\%0`*\)\),%ql)),lnum(%1,%2), ,strfirstof(%3,%b)))
&PFUN`XLATTR`MAX Leaf Attribute Functions=4
&PFUN`XLATTR`MIN Leaf Attribute Functions=3
&PFUN`XLATTRP Leaf Attribute Functions=objeval(%@,elements(remove(setr(l,lattrp(first(%0,/)/[strfirstof(rest(%0,/),**)])),filterbool(#lambda/strlen\(grab\(%ql\,\%0`*\)\),%ql)),lnum(%1,%2), ,strfirstof(%3,%b)))
&PFUN`XLATTRP`MAX Leaf Attribute Functions=4
&PFUN`XLATTRP`MIN Leaf Attribute Functions=3
&STARTUP Leaf Attribute Functions=@dol lattr(%!/PFUN`)={@FUNCTION/PRESERVE after(##,PFUN`)=%!, ##, [get(%!/##`min)], [get(%!/##`max)], [get(%!/##`res)]}
@set Leaf Attribute Functions/STARTUP=no_command prefixmatch