Discussion:
OBNC interface with C code return array of char
(too old to reply)
g***@gmail.com
2020-03-27 12:00:54 UTC
Permalink
I want to interface with C code whose return a C string which is an array of char. I found it to be impossible.

So I tried to declare a new type as array of char but it is impossible, too.

To last resort I tried to declare a new type as pointer to char, then it is impossible too as the compiler will not allow pointer to non record type.

I stuck at this stage because if I can't write the declaration module in Oberon how could I go further to do the actual implementation in C source file?

Oberon is viewed as a compact and beautiful language but if it's too limited like that it's too useless for any practical purpose other than an academic research project.
August Karlstrom
2020-03-27 21:32:33 UTC
Permalink
Post by g***@gmail.com
I want to interface with C code whose return a C string which is an
array of char. I found it to be impossible. >
So I tried to declare a new type as array of char but it is impossible, too.
To last resort I tried to declare a new type as pointer to char, then
it is impossible too as the compiler will not allow pointer to non
record type.
I stuck at this stage because if I can't write the declaration module
in Oberon how could I go further to do the actual implementation in C
source file?
In Oberon, strings are returned as output parameters; i.e. variable
parameters of type ARRAY OF CHAR. Therefor you need to adjust the
signature of the procedure accordingly.
Post by g***@gmail.com
Oberon is viewed as a compact and beautiful language but if it's too
limited like that it's too useless for any practical purpose other
than an academic research project.
Why do you use it then?


-- August
g***@gmail.com
2020-03-30 05:34:35 UTC
Permalink
Post by August Karlstrom
Why do you use it then?
-- August
I'm experiment with it but not seriously put on my faith on it. So after a while I have a conclusion that it is not for me. OK?
c***@gmail.com
2020-03-28 00:11:02 UTC
Permalink
Post by g***@gmail.com
Oberon is viewed as a compact and beautiful language but if it's too limited like that it's too useless for any practical purpose other than an academic research project.
We have a number of customers who would disagree with you. e.g.

"Oberon in Atlantic City"

https://www.astrobe.com/forum/viewtopic.php?f=3&t=505
g***@gmail.com
2020-03-30 05:32:57 UTC
Permalink
Post by c***@gmail.com
Post by g***@gmail.com
Oberon is viewed as a compact and beautiful language but if it's too limited like that it's too useless for any practical purpose other than an academic research project.
We have a number of customers who would disagree with you. e.g.
"Oberon in Atlantic City"
https://www.astrobe.com/forum/viewtopic.php?f=3&t=505
This is embedded software. I want to use Oberon (OBNC) to develop software for the normal PC. Intefacing with C library is a must. But it too difficult. That's why I said Oberon is useless for my job.
Loading...