Next: Chunk, Previous: Language constructs, Up: Cocytus
Definers are used to define new global values. Standard L cocytus package provides several standard definers:
This definer makes it possible to define new functions, that can later be compiled.
L's style encourage creation of new definer. For instance, imagine that you are developping a PCI device driver interface. Then, a device driver should look like:
pci_device_driver my_driver { name: "my-driver"; probe: my_probe_function; remove: my_remove_function; suspend: my_suspend_function; resume: my_resume_function; } Error_Code my_probe_function(Pci_Info inf) { ... }
Any change of interface would be immediately known at compile time: for instance, if a suspend is deprecated, the definer can warn the developper when it is called; and so on.
UNIMPLEMENTED This is also how Cocytus backends should be declared:
Cocytus_Backend pretty_GNU_C_backend { let: pgc_compile_let; =: pgc_compile_assign; }
A warning or error message could then be issued when a Cocytus backend does not follow a change in Cocytus; or does not fully implement it for instance.
Finally, the ability to add new definers make it possible to transform L into a declarative language, or more generally use declarative constructs, so writing what you want to have instead of writing how to obtain it.