27.Extended /ialmark to allow setting arbitrary marks using the format:
/ialmark -nr <nick> [name] [text]
-n = the [name] of the mark. If -n is not used, the default name
'mark' is used.
-r = remove the mark
Marks can be accessed using $ialmark(nick,N/mark) and properties
'mark' and 'value'.
Ok, so, out of the gate, I'm not sure when or where the '.mark' property is meant to be used. It seems to me that $ialmark() without a property will always behave as if the '.mark' property is used with it.
Can these new marks be used with regular $ial() and with $ialchan() ?
Only unusual behavior I see so far is $ialmark(Raccoon) without N specified will behave as if N = 1. (and as if the .mark property is used, of course.)
Could you elaborate a little more about this design, and I'll try to break all of those aspects you describe.
Here's some test examples:
/ialmark -n Raccoon server cards.freenode.net
/ialmark -n Raccoon joined.#mIRC 1488047314
/ialmark -n Raccoon spoke.#mIRC 1488047485
Behaviors I observe:
$ialmark(Raccoon,0) == 3 (good)
$ialmark(Raccoon,1) == server (good. 'N' implies .mark)
$ialmark(Raccoon,1).value == cards.freenode.net (good)
$ialmark(Raccoon,1).mark == server (ok. good.)
$ialmark(Raccoon,server) == server (redundant? expected implied .value, same as $hget()?)$ialmark(Raccoon,server).value == cards.freenode.net (ok. but shouldn't require .value)
$ialmark(Raccoon,server).mark == server (ok. good.)
$ialmark(Raccoon) == server (odd.)$ialmark(awyhtlwjfkuihsfelk) == $null (good.)
Behavior I would expect:
$ialmark(Raccoon,server) == cards.freenode.net
$ialmark(Raccoon) == should be Raccoon(?) or the value of default unnamed mark (no -n switch used)?
* Being a hash list, the mark N=1 will change as more mark names are added and shuffle around the internal hashlist.
Request:
/ialmark -nrw Raccoon *
/ialmark -nrw Raccoon joined.*
Notes:
I can't find a specific use case for the $ialmark().mark property since it is always implied. The $ialmark().value property could be useful if a mark name is itself a numeric value.
* Update: Wims points out that .mark can be used to verify an item is really an item. if ($ialmark(Raccoon,server).mark) { exists }