Page 3 of 3

Re: Further revision of Oberon-07

Posted: Sat Oct 01, 2011 10:54 am
by augustk
If the path in your example is to be exported as a constant, say, it gets a bit more involved if we decide to add quotes. A module like

Code: Select all

MODULE M;

	CONST path* = "C:\temp\";

END M.
will turn into something like this:

Code: Select all

MODULE M;

	CONST quotes = 22X;

	VAR path: ARRAY 10 OF CHAR;

	PROCEDURE GetPath*(VAR out: ARRAY OF CHAR);
	BEGIN
		COPY(path, out)
	END GetPath;

BEGIN
	path := " C:\temp\ ";
	path[0] := quotes;
	foo[9] := quotes
END M.
It is unfortunate that character array variables cannot be exported.

Re: Further revision of Oberon-07

Posted: Sat Oct 01, 2011 8:25 pm
by kevinhely
Well, I'm afraid I'm not convinced that the example you gave justifies the assertion that
That 'solution' creates more problems than it solves.
The "escaping" use of the backslash character is well-established and has certainly never caused me any difficulties in path name processing in C or Java (e.g. in the compilers I've written). I understood the string you'd written in your example straight away (as I'm sure any competent C/Java programmer would). However, with the single-quote string delimiters, the code of your example would have been simpler and clearer.

I applaud the simplification achieved by the elimination of "character constants" but eliminating single-quote delimiters was unnecessarily parsimonious. (Perhaps they'll return in a later revision ;) )

Regards,
K.

Re: Further revision of Oberon-07

Posted: Mon Oct 03, 2011 8:37 pm
by augustk
i would vote for the introduction of a predefined procedure for (compile-time) string concatenation. This function procedure (with a variable number of parameters) could be named UNION. With this minimal addition to the language all strings can be represented. Like kevinhely, I would also like to see the reintroduction of single quotes. The constant declaration in my previous example can then be written like this:

Code: Select all

path* = UNION('"', "C:\temp\", '"')

Re: Further revision of Oberon-07

Posted: Wed Oct 05, 2011 2:00 pm
by kevinhely
With single quotes, your code can be

Code: Select all

path* = '"C:\temp\"'
:)

Re: Further revision of Oberon-07

Posted: Wed Oct 05, 2011 6:48 pm
by augustk
OK, you got me, but I am sure you get my point. With the compile-time concatenation procedure all strings can be represented, just as all representable booleans, numbers and sets can be denoted by constant literals. It is a matter of completeness.

Re: Further revision of Oberon-07

Posted: Thu Oct 06, 2011 1:32 pm
by kevinhely
Sure. :)

Re: Further revision of Oberon-07

Posted: Wed Dec 24, 2014 5:27 am
by cfbsoftware
augustk wrote:It is unfortunate that character array variables cannot be exported.
Export of record and array variables in read-only mode was implemented in v5.1 of Astrobe following the changes in revision Rev 1.10.2013 / 10.03.2014 of the Oberon Language Report.