A route is defined as a [String, String] tuple. What is the most appropriate way to define type alias 'Route' as [String, String]? e.g.
defn same-route? ( x : [String,String], y : [String,String] ) -> True|False :
I would like to use
defn same-route? ( x : Route, y : Route ) -> True|False :
instead.
The standard way would be to define a
Route
struct that wraps the Strings:Inside
same-route?
you can compare thestart
andend
fields.The preferred way to compare equality is to subtype
Equalable
and implement theequal?
method:==
is a macro forequal?
, so this enables the following code: