[Oberon] Variadic functions or procedures, VARARG ...

Lars noreply at z505.com
Wed Jan 27 02:33:26 CET 2016


Hi, I can't find any information on Variadic functions for oberon or how
one would interface to a C function that is variadic. Does oberon use any
trick to support this, or it forbids you from using variadic or
interfacing with variadic?

Just to recap what variadic means, it's a function like this:

PROCEDURE Something(param1: INTEGER; otherparams...)

The ... means multiple parameters. In freepascal I believe this is known
as VARARGS whereas C and golang call it variadic function.

I'm guessing this is forbidden because oberon prefers everything to be
fixed and known up front, and variadic functions go against the psychic
programmer philosophy of huge design up front and knowning everything
about everything. i.e. define the exact amount of parameters up front, or
go home and you aren't welcome here... or something like that.

But how would oberon interact with a C library with variadic function
accepting multiple parameters?

Varidiac functions have been proven to be extremely useful in Golang
although they are one of those double edged swords that is extremely
useful, until someone uses it for abuse. So I am guessing oberon outright
forbids it...

Any information would be helpful. Would also be nice to hear Wirth's
comments on it in one of his books or articles since he refuses to
communicate with Human DNA and only communicates with Wine and Cheese
eating non spinach alien DNA's. (this is a serious question about variadic
function support in oberon, but the email most definitely contains some
humor worth every nickle)


More information about the Oberon mailing list