View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000707 | LDMud | Implementation | public | 2009-12-11 19:08 | 2021-04-16 22:26 |
| Reporter | sinnvoll | Assigned To | |||
| Priority | normal | Severity | feature | Reproducibility | have not tried |
| Status | closed | Resolution | won't fix | ||
| Summary | 0000707: unit types | ||||
| Description | I propose an extension for the type system. An characterstring stored additional to the standardtypes. The new types could inherit the standardtypes operations. They would have an cast to its standardtype. The interesting part would be the type-check. 1 meter != 1 second // -> true set_duration(1 meter); // -> error That given mapping and array could be parameterized: 3dpoint[30 x][40 y][50 z] This should produce errors when twisting indices. Syntax: unittype meter int; unittype second int; int a=1; meter x= meter(a); meter y= meter(15); printf("%d",to_int(x+y)); | ||||
| Tags | No tags attached. | ||||
| External Data (URL) | |||||
|
|
I think, this concept is a bit too high-level for the LPC language itself. Especially, when it comes to complex units (like W), you basically need to program a lot of rules for unit conversions. And it is anyway not sufficient to hard-wire these rules, because anybody is free to name units or devise new units as he or she wants... |
|
|
We think that is too complex to be handled on the LPC language level. Therefore closing this ticket. |