123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- type Framework enum {
- type React;
- type Vue;
- type Angular;
- type Polymer;
- type Svelte;
- type Elm;
- type Purescript;
- };
- const React: Framework := { |Framework| { |React| () } };
- const Vue: Framework := { |Framework| { |Vue| () } };
- const Angular: Framework := { |Framework| { |Angular| () } };
- const Polymer: Framework := { |Framework| { |Polymer| () } };
- const Svelte: Framework := { |Framework| { |Svelte| () } };
- const Elm: Framework := { |Framework| { |Elm| () } };
- const Purescript: Framework := { |Framework| { |Purescript| () } };
- export function get-color:
- &(Framework) => String
- &(framework) =>
- switch framework:
- case React,Elm: 'lightblue',
- case Angular,Svelte: 'red',
- case Vue: 'green',
- case Polymer: 'pink',
- case Purescript: 'black',
- end;
- do
- let checklist := [
- (React, 'lightblue'),
- (Vue, 'green'),
- (Angular, 'red'),
- (Polymer, 'pink'),
- (Svelte, 'red'),
- (Elm, 'lightblue'),
- (Purescript, 'black')
- ],
- let ok := checklist
- . { Seq }
- . { every &(framework, color) =>
- (framework.{get-color} = color) },
- { os::println { String ok } }
- . { crash-on-error };
|