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

Re: Looking for devious one or two liner solutions to a problem



On Oct 10,  8:35pm, Bart Schaefer wrote:
}
} And if you return the new version in $a (since you've already made it
} non-local) and therefore don't bother printing it, 71 characters:
} 
} f(){a=(${(s:.:)1});a[$2,3]=($[${a[$2]}+1] 0 0 0);a=${(j:.:)${a[0,3]}}}

Hmm, I may have just found a parser bug.  That doesn't work; you need
one more space or sem between the assignment and the closing brace:

f(){a=(${(s:.:)1});a[$2,3]=($[${a[$2]}+1] 0 0 0);a=${(j:.:)${a[0,3]}};}


Afterthought:  Of course the next interview question is to show them
a string like that and ask "What does this do?"



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