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

From: [at]} <Aubrey.McIntosh{>
Date: Sat, 4 Jul 2009 14:26:35 -0500

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

I did some work on a problem that colors my interpretation of this
discussion on complex numbers.

Sometimes physical scientists pay attention to how many significant
figures are in a number. For example, 1.234 + 5.6 = 6.8.

Also, today I am working on a project with multiple currencies, and I
find that Josef Temple's interest in Decimal types resonates with me.
(I did explore Dialog and found something, either currency or decimal,
that was useful.)

I wrote some routines to support significant figures so long ago it
was written in Modula-2, and have ported these to Oberon V4. I assume
that I easily can and eventually will port this into Blackbox.

I can suggest a structure like
   Real = POINTER TO RECORD
     real : REAL;
     expOfSigDigit : INTEGER;
   END;

Then there are the operations, such as addops and mulops, on these numbers.
  PROCEDURE Add (this, that: Real): Real;
  PROCEDURE Mul (this, that : Real): Real;

I then built some matrix algebra routines on top of these entities.
So, for example, I can find the eigenvectors of a matrix with
attention to significant figures.

So:
I produced a real program using (only) a pointer type for function returns.
I defined (as procedures) any operation that I desired.
I found I could change
  a := b+c;
into
  a := Add (b,c);
using (in Oberon V4) RegExp. Today, I would probably use Coco and the
language grammar to make some automatic source --> source translator.
I am able to read the source code without particular trouble.

What I don't see is why this approach is not good with complex. What
won't work?



On Sat, Jul 4, 2009 at 1:42 PM, Georgy Jikia<georgy.jikia{([at]})nowhere.xy
> Let me try to ask a slightly different question. Suppose I do need COMPLEX
> data types in BlackBox and I am ready to get my hands dirty and implement
> COMPLEX as a new basic type. So a new COMPLEX basic type should be defined,
> mathematical operations should be implemented and the new type should be
> available in modules importing COMPLEX. Without procedures
> returning structured types and without operator overloading the
> implementation could only be done by extending system modules of the
> BlackBox. Although implementation using standard BlackBox modules is not
> possible, it seems COMPLEX could be implemented similar to SYSTEM or COM
> (pseudo-) modules, which do not exist as usual BlackBox SYSTEM.odc or
> COM.odc, but are hard coded  in Dev subsystem. The problem is that the
> documentation for BlackBox modules intended for internal use only is absent.
> So, can somebody who knows inner workings of BlackBox make a comment on how
> such an extension of the core of BlackBox could be done? Can such an
> extension be localized or would it have to be spread all over the system
> modules? I guess the task is much more difficult, than writing overloaded
> operations in active oberon or C++, but it is interesting to know how much
> more difficult?
>
> Georgy
>
>
> ---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
> LISTSERV{([at]})nowhere.xy



-- 
-- 
Aubrey McIntosh, Ph.D.
1502 Devon Circle
Austin TX 78723-1814
http://home.grandecom.net/~amcintosh/aubrey/Search/
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1752506666_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCBJIGRpZCBzb21lIHdvcmsgb24g
YSBwcm9ibGVtIHRoYXQgY29sb3JzIG15IGludGVycHJldGF0aW9uIG9mIHRoaXNccGFyDQpkaXNj
dXNzaW9uIG9uIGNvbXBsZXggbnVtYmVycy5ccGFyDQpccGFyDQpTb21ldGltZXMgcGh5c2ljYWwg
c2NpZW50aXN0cyBwYXkgYXR0ZW50aW9uIHRvIGhvdyBtYW55IHNpZ25pZmljYW50XHBhcg0KZmln
dXJlcyBhcmUgaW4gYSBudW1iZXIuICBGb3IgZXhhbXBsZSwgMS4yMzQ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KPiBMSVNUU0VSVkBMSVNUUy5PQkVST04uQ0hccGFyDQpccGFyDQpccGFyDQpccGFyDQot
LSBccGFyDQotLSBccGFyDQpBdWJyZXkgTWNJbnRvc2gsIFBoLkQuXHBhcg0KMTUwMiBEZXZvbiBD
aXJjbGVccGFyDQpBdXN0aW4gVFggNzg3MjMtMTgxNFxwYXINCmh0dHA6Ly9ob21lLmdyYW5kZWNv
bS5uZXQvfmFtY2ludG9zaC9hdWJyZXkvU2VhcmNoL1xwYXINClxwYXINClxwYXINCi0tLS1ccGFy
DQpUbyB1bnN1YnNjcmliZSwgc2VuZCBhIG1lc3NhZ2Ugd2l0aCBib2R5ICJTSUdOT0ZGIEJMQUNL
Qk9YIiB0byBMSVNUU0VSVkBMSVNUUy5PQkVST04uQ0hccGFyDQp9
----boundary-LibPST-iamunique-1752506666_-_---
Received on Sat Jul 04 2009 - 21:26:35 UTC

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