Changeset 84886499


Ignore:
Timestamp:
Mar 26, 2024, 1:06:38 PM (5 weeks ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
67467a3
Parents:
7b05de4
Message:

Small update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/jiada_liang_MMath/relatedwork.tex

    r7b05de4 r84886499  
    22362236\end{ocaml}
    22372237The only operations are binding and pattern matching (equality), where the variant name is logically the implementation tag stored in the union for discriminating the value in the object storage.
    2238 OCaml compile store tags as ascending int, starting from 0. Variants @Mon@ to @Sun@ are stored as int value 0 to 6.
     2238After compilation, variant names are mapped to an opague ascending intergral type discriminants, starting from 0.
    22392239Here, function @take_class@ has a @weekday@ parameter, and returns @"CS442"@, if the weekday value is @Mon@ or @Wed@, @"CS343"@, if the value is @Tue@ or @Thu@, and @"Tutorial"@ for @Fri@.
    22402240The ``@_@'' is a wildcard matching any @weekday@ value, so the function returns @"Take a break"@ for values @Sat@ or @Sun@, which are not matched by the previous cases.
Note: See TracChangeset for help on using the changeset viewer.