n = 99 nbottles = (n:1:-1) $>"No more" outa_beer = datatype.each(nbottles)!=INT plural = ("s","")[`==='.each(nbottles,cast(INT,1))] todolist = ("Take one down and pass it around" ... ,"Go to the store and buy some more") ... [outa_beer] song = "%s bottle%s of beer on the wall, %s bottle%s of beer.\n" ... "%s, %s bottle%s of beer on the wall.\n\n" m = cat(cat(cat(lam(nbottles,plural) ... ,lam(lowercase_quant(nbottles),plural)) ... ,todolist) ... ,lam(lowercase_quant(rot(1,nbottles)) ... ,rot(1,plural))) displ sprintf(song,$>m) //------------------ func lowercase_quant { textmask = datatype.each(arg)!=INT return (merge(textmask ... ,(sel(!textmask,arg) ... ,each(`xlat.lower',sel(textmask,arg))))) }