I am new to DAML and I am learning by using Airline Model. I have question from Airline DAML model about t
he === used and if you can please explain the following code.
As @a_putkov replied to you here, === is the infix version of the assertEq function. Which means, these two lines are checking and making sure that the CheckIn exercise is performed with a flight that matches the flightNumber and airline data stored on the ticket. If the values are not equal the rest of the exercise - checking for the seatâs Class, creating a BoardingPass and exercising AssingSeat on it - wonât be performed.
== is an operator that returns a boolean value, where True means the two values are equal. It is part of the âbase languageâ (Prelude) so it is always available.
=== is an operator that throws an exception if the two values are not equal. Itâs mostly useful in tests. It is part of the DA.Assert package and thus needs to be explicitly imported.
Damlâs documentation search works well with symbolically-named functions. Head over there and type in ===, and the only result that comes up is âInfix version of assertEq.â assertEq is documented nearby, if youâre getting acquainted with that function.
General-purpose search engines are not so great with searching for symbols; I strongly recommend trying the Daml Docs search first.