TYL PROGRAMMING LANGUAGE
▶ RECORDS ASSIGNMENT
Assign Record by Another Record
In records declaration page, we learned how to declare a record implicitly. But there are other ways to declare or assign a record.

One of them is to create the record from another record:
location { long -72.93 lat -41.47 }

loc location
print loc
loc: {
 long: -72.93
 lat: -41.47
 }
In line: loc location, loc record is declared and assigned by location record. On assignment, loc gets all the mapping data from location record.

If we change loc record, and assign it back to location record:
location { long -72.93 lat -41.47 }

loc location
loc.long 180 + loc.long
location loc

print location
location: {
 long: 107.07
 lat: -41.47
 }
We see that location record changed.

Usually, when we want to change a record we will act on it directly or functionally. But what if the record has key with a record value:
country { name 'Palau' }
location { long 135 lat 7.5 }
country.location location
print country
country: {
 name: 'Palau'
 location: : {
  long: 135
  lat: 7.5
  }
 }
We defined country record, with name key. To define a record key, we prepared the location value record separately.
In line: country.location location, we add record location key with location record as its value.
Printing the country record, we can see that it has location key with location record value

If we want to set country location record key, we'll add these three lines:
location.long -111
country.location location
print country
country: {
 name: 'Palau'
 location: : {
  long: -111
  lat: 7.5
  }
 }
In line: country.location location, we assign country location the changed location record.
PART 4
PART 6