The types in most programming languages are only technical types. If a variable 
has a type, you may know that it is of type integer or double, but you don't 
know if it's a length or an area.
  The types required are semantic types.

  stypes: length
  area
  time
  speed
  scalar
  allowed expressions: length = length
  length + length : length
  time = time
  time + time : time
  scalar * length : length
  scalar * time : time
  sqrt(area) : length
  speed = speed
  length / time : speed
  foo : time
  bar : length
  baz : length

  bar = 23
  baz = 42.3
  foo = 17.4
  speed'variable = (bar + baz) / foo
  baz = length'5
  bar = length'foo

  Python's dynamic type checking remains.

  These type names are all user defined. A type name with a tick before an 
expression means that this expression has the semantic type of the type name. 
The function names in the allowed expressions statement don't need to be names 
of existing functions.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/SPQJKVIKO3Y5IVLB35NGSRU27RMHXMXU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to