BigEd / atalan

Automatically exported from code.google.com/p/atalan
MIT License
1 stars 0 forks source link

Polymorphic functions #94

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Declared like 

  binary: x, y -> s
  add: binary
  sub: binary

Original issue reported on code.google.com by rudla.ku...@gmail.com on 26 Sep 2011 at 3:47

GoogleCodeExporter commented 9 years ago
Should be more like

  type binary:proc x,y:0..255 -> s:0..255
  add:binary = return x + y
  sub:binary = return x - y

  op:adr of binary

  op = add
  r = op 20 10
  "[r]"

Compiler must make sure, that all procedures of type 'binary' use the same 
addresses (registers), so the polymorphic call may succeed.

Original comment by rudla.ku...@gmail.com on 26 Sep 2011 at 4:05

GoogleCodeExporter commented 9 years ago

Original comment by rudla.ku...@gmail.com on 21 Jan 2012 at 8:19