# Def sqr x = x * x end

I find

def sqr x = x * x end

nicer than

def sqr x ; x * x end

Mikkel

Surely, though, the first implies the method has a side-effect of changing the
value of x, which is obviously not the intention of the function. In fact,
what’s the point of doing an assignment whose value you never use?

My \$0.02

···

On Sun, 11 Aug 2002 08:47, you wrote:

I find

def sqr x = x * x end

nicer than

def sqr x ; x * x end

“Harry Ohlsen” harryo@zip.com.au wrote in message
news:200208110906.22947.harryo@zip.com.au…

I find

def sqr x = x * x end

nicer than

def sqr x ; x * x end

Surely, though, the first implies the method has a side-effect of changing
the
value of x, which is obviously not the intention of the function. In
fact,
what’s the point of doing an assignment whose value you never use?

Right, I was drawing parallels to another language without thinking
Comparisons only go so far.

def sqr(x) x * x end

is also nice, and it works.

Mikkel

···

On Sun, 11 Aug 2002 08:47, you wrote: