I see what I did wrong:
if (is_tile(win,p.x,p,y)
has to be:
if (is_tile(win,p.x,p.y)
Damn typo............ did a comma instead of a dot