Re: [BLACKBOX] BlackBox 1.6 final version - COMPLEX datatypes?

From: [at]} <Josef>
Date: Sun, 5 Jul 2009 16:54:27 +0200

----boundary-LibPST-iamunique-1516240165_-_-
Content-type: text/plain

> It would have the additional benefit of allowing DECIMAL maths, MATRIX maths,
> etc. etc. all of which could then be implemented by others without any
> knowledge of the internal workings of the compiler. As well as overloaded
> operators and structured returns some mechanism would also be need to allow
> the programmer to define complex literal values e.g. COMPLEX(1.0, 2.0).

Once again, I am not sure that structured return types are really necessary for
supporting operator overloading on structured types.
It seems to me that a very simple convention would also suffice:

Use IN params for the inputs and a single OUT param for the result.

e.g.:

PROCEDURE "+" (IN x, y: COMPLEX; OUT z: COMPLEX);

This has the advantage that it avoids copying the
result value in the RETURN statement!
The compiler can transform an expression that contains such operators
in a sequence of procedure calls and it would have to introduce
appropriate local variables. I would expect this step to be rather
straight forward.

I guess, MATRIX operations are significantly more complicated because
there is no fixed type MATRIX at all. So they will probably need
dynamic memory depending on the number of rows and columns.


- Josef


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1516240165_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwID4gSXQgd291bGQgaGF2ZSB0aGUgYWRkaXRpb25h
bCBiZ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Gl0IGF2b2lk
cyBjb3B5aW5nIHRoZSBccGFyDQpyZXN1bHQgdmFsdWUgaW4gdGhlIFJFVFVSTiBzdGF0ZW1lbnQh
XHBhcg0KVGhlIGNvbXBpbGVyIGNhbiB0cmFuc2Zvcm0gYW4gZXhwcmVzc2lvbiB0aGF0IGNvbnRh
aW5zIHN1Y2ggb3BlcmF0b3JzXHBhcg0KaW4gYSBzZXF1ZW5jZSBvZiBwcm9jZWR1cmUgY2FsbHMg
YW5kIGl0IHdvdWxkIGhhdmUgdG8gaW50cm9kdWNlIFxwYXINCmFwcHJvcHJpYXRlIGxvY2FsIHZh
cmlhYmxlcy4gSSB3b3VsZCBleHBlY3QgdGhpcyBzdGVwIHRvIGJlIHJhdGhlciBccGFyDQpzdHJh
aWdodCBmb3J3YXJkLlxwYXINClxwYXINCkkgZ3Vlc3MsIE1BVFJJWCBvcGVyYXRpb25zIGFyZSBz
aWduaWZpY2FudGx5IG1vcmUgY29tcGxpY2F0ZWQgYmVjYXVzZVxwYXINCnRoZXJlIGlzIG5vIGZp
eGVkIHR5cGUgTUFUUklYIGF0IGFsbC4gU28gdGhleSB3aWxsIHByb2JhYmx5IG5lZWRccGFyDQpk
eW5hbWljIG1lbW9yeSBkZXBlbmRpbmcgb24gdGhlIG51bWJlciBvZiByb3dzIGFuZCBjb2x1bW5z
LlxwYXINClxwYXINClxwYXINCi0gSm9zZWZccGFyDQpccGFyDQpccGFyDQotLS0tXHBhcg0KVG8g
dW5zdWJzY3JpYmUsIHNlbmQgYSBtZXNzYWdlIHdpdGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIg
dG8gTElTVFNFUlZATElTVFMuT0JFUk9OLkNIfX0AnW4A3Q==
----boundary-LibPST-iamunique-1516240165_-_---
Received on Sun Jul 05 2009 - 16:54:27 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:43 UTC