# How to define a command using \lowercase in \csname

I was being lazy and had a lot of commands of the form

\def\foo{...Foo...}


So I was thinking about taking an approach like

\def\bar#1{\expandafter\gdef\expandafter\csname\lowercase{#1}\endcsname{...#1...}


or something along the lines of

\def\bar#1{\edef\tmp{\lowercase #1}\expandafter\gdef\expandafter\csname\tmp\endcsname{...#1...}}


wanting to use it like \bar{Foo}} and followed by \foo, but this obviously won't work because \lowercase can't be expanded further. How do I do this properly?

\def\bar#1{\lowercase{\expandafter\gdef\csname#1\endcsname}{...#1...}