moon2sun00
moon2sun00

Reputation: 51

Why I am getting illegal pattern on pattern matching?

1> X = 10.
10
2> Y = 9.
9
3> X - 1 = Y.
* 1: illegal pattern
4> Y = X - 1.
9
5> 10 - 1 = Y.
9

Can you explain to me what illegal pattern in query 3> is? Thanks!

Upvotes: 5

Views: 152

Answers (1)

nu-ex
nu-ex

Reputation: 681

The variable that you are binding to needs to be on the left side, not the right.

This is the correct expression:

Y = X - 1.

Upvotes: 6

Related Questions