× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Shouldn't that be ++Thomas Raddatz? Or Thomas Raddtz++?

Thanks,

Marvin
------------------------------

message: 2
date: Tue, 8 Oct 2013 10:25:05 +0300
from: Emil Sommarstr?m <emil.sommarstrom@xxxxxxxxx>
subject: Re: Free format H, F, D and P specs

Thomas Raddatz +1!




2013/10/8 <thomas.raddatz@xxxxxx>


I almost agree with Alan. Although I do not necessarily need a new
compiler I think that IBM again missed a good chance to really modernize
/free. For example from the day when IBM introduced procedures with V3,
I
wonder why we have to use P specs to start/end a procedure and D specs
for
the procedure interface. Using only P specs whould have been a lot
easier
and clearer (at least for me):


Prototype:

P startsWith...
P P N
P i_prefix 4096A const varying
P i_string 4096A const varying


Implementation:

P startsWith...
P B N export
P i_prefix 4096A const varying
P i_string 4096A const varying
/free

/end-free
P E

I do not believe that having done it this way would have have been much
more expensive.

What I want to say is that on my opinion IBM tends to stay to close to
the
old things. IBM prefers using START/END tags where other languages uses
brackets which are often clearer to read. For example:

ctl-opt dftactgrp(*no);
ctl-opt main(main);

dcl-proc main(caller_name char(10) const) {

dcl-c RECORD_LEN 80;
dcl-f qprint printer(RECORD_LEN);

dcl-ds prtDs len(RECORD_LEN) qualified {
*n char(6) inz('Hello'),
name char(50),
};

prtDs.name = transform(caller_name);
write qprint prtDs;

*inlr = '1';

dcl-proc varchar(50) transform(
name varchar(10) const options(*trim)) {
return '*** ' + name + ' ***';
};

Actually there is no need for 'dcl-pi'. There are only procedures and
the
main procedure is indicated by 'ctl-opt main(main)' or even just by
name:
'main'.

I do not know much about building professionell parsers and compilers
but
I do not think that my example would have been that much expensive.
'dcl-proc' is the same and instead of 'end-proc' the compiler had to
look
for the closing curly bracket. 'dcl-pi' and 'end-pi' are replaced by
brackets, too.

Just my two cents.

Thomas.

PS: Here is what I actually wished to get:

options dftactgrp(*no), main(main);

procedure main(caller_name char(10) const) {

const RECORD_LEN 80;
file qprint printer(RECORD_LEN);

structure prtDs len(RECORD_LEN) qualified {
*n char(6) inz('Hello'),
name char(50),
};

prtDs.name = transform(caller_name);
write qprint prtDs;

*inlr = '1';

procedure varchar(50) transform(
name varchar(10) const options(*trim)) {
return '*** ' + name + ' ***';
};

Notice: This e-mail transmission may contain information that is proprietary, privileged and/or confidential and is intended exclusively for the person(s) to whom it is addressed. This message may also contain Protected Health Information (PHI) and must be treated confidentially and handled in accordance with HIPAA and other federal and state privacy laws. Any use, copying, retention or disclosure by any person other than the intended recipient or the intended recipient's designees is strictly prohibited. If you are not the intended recipient or their designee, please notify the sender immediately and delete this e-mail (and any accompanying attachments).

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.