# = in conditional

Why does the following compile fine (and work) :

```if the number understood < the x_value of the player begin; say "something." instead; end if;```

but the following result in a compile error:

```if the number understood = the x_value of the player begin; say "something." instead; end if;```

with an error of :
Problem. In the sentence ‘if the number understood = the x_value of the player begin’ , I was expecting to read a condition, but instead found some text that I couldn’t understand - ‘number understood = the x_value of the player’.

I know I can fix it with:

``if the number understood [b]is[/b] the x_value of the player``

but I’m struggling to grasp why I7 can not appropriately deal with < and not = in a conditional. It’s not immediately apparent to anyone picking I7 up.

McT

The greater-than and less-than signs were added as abbreviations for the longer (but more idiomatic) phrases “is greater than” and “is less than”. A double-equals for comparison would be exactly the same length as “is” and thus not really abbreviate anything. Note, however, that the equals sign is accepted in equations (where it’s assumed you’ll be using mathematical notation).

Boo. Sorry, but that’s just bad form. If you’re going to allow math notation as conditionals, then you’ve got to allow it - not just some of it so a developer doesn’t know what’s what. It vexes me that the phrases ‘is equal to’ or ‘equals’ also don’t compile.

This is just a bad design decision.

It strikes me that ‘is’ is far less intuitive than = or equivalent phrases.

Anyway.

Mct.

You could define these:

``````The verb to be equal to means the equality relation.

To decide whether (X - value) =/equals (Y - value):
if X is equal to Y:
yes.``````

Note that this is not the usual programming-language use of the “=” symbol. You can’t say

x = 5;

It’s also not the same as “is”, which is a much broader concept in I7. (You can say “if the lamp is lit…” but that isn’t the equality relation. It makes no sense to say “if the lamp = lit”.)

You could make a suggestion on the Uservoice forum to have this be included. I’d probably upvote it if I have any upvotes I can free up.

Agreed, in the main, but this is so, usually, that you can combine conditional and math statements into a compound statement, and in this case, the context is impossible to determine, but in i7, as I understand, this isn’t allowed. So I can’t say ‘if (a=sin(b)) is true’ (where a also takes on the value inferred- yeah, bad example - it’s late) so, in i7 it should be trivial to contexualise the = sign. (Maybe I’m wrong here)

It’s a small point, but I think my main gripe is around consistency
‘is greater than’ or ‘is less than’ but not ‘is equal to’
< or > but not =

It makes a language which needs to be intuitive needlessly less so.

McT