Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ISO standard and FPC

118 views
Skip to first unread message

Marco van de Voort

unread,
Oct 31, 2012, 5:50:06 AM10/31/12
to
To have some positive news in this group also, in trunk (v2.7.1) FPC got a
bit more ISO compatible again.

A first implementation of std-io syntax (description^) was added, and in ISO
mode other reserved words (like STRING) are hidden.

I tried to compile P5, and now it bombs on instantation of specific variants
of variable (case) records with new().

rug...@gmail.com

unread,
Nov 3, 2012, 1:12:20 AM11/3/12
to
Hi,

On Wednesday, October 31, 2012 4:50:07 AM UTC-5, Marco van de Voort wrote:
>
> To have some positive news in this group also, in trunk (v2.7.1) FPC got a
> bit more ISO compatible again.

Cool. Yes, I downloaded the GO32v2 trunk version from FPC's FTP and (very very) lightly played with it (on my desktop).

> A first implementation of std-io syntax (description^) was added, and in ISO
> mode other reserved words (like STRING) are hidden.
>
> I tried to compile P5, and now it bombs on instantation of specific variants
> of variable (case) records with new().

I'm no expert on ISO 7185, but apparently (checking Doug Cooper's book) variant records have three ways of being used. (I'm still green on some of the darker corners.)

1). variant record with tag, i.e. discriminated union-type (size of largest alternative)
2). variant record with no tag, i.e. free union-type
(figures out what it is upon initialization but you can't change it later, or else you won't be able to easily test what it is anymore)
3). smallest union, i.e. new(myinteger, mysmallint) will only allocate the smallest part specifically needed. So this seems like just a way to save precious RAM, which is copious these days. So you can presumably just change it to "new(myinteger);" and it should? still work fine.

I could be wrong, but that's my current understanding. I did try building pcom.pas and pint.pas. Actually, here you seem to specifically refer to pcom.pas , and I'm somewhat surprised you didn't figure pint was more urgent or important to start with first.

Anyways, there are obviously other problems, so it gets a bit hairy. You say some of ISO I/O is implemented, but it seems that get() and put() aren't, which is still needed. Hmmm, I can't remember what else, but there were other things.
Oh, EOF(bytfileb[i]) or something whines because it expects type "text" instead. And there were a few other goofy places, such as no support for page() , which seems almost silly as I thought it was implementation defined anyways. Probably something else, but I'm not comfortable playing much with it on this laptop, so I'll have to try again later.

BTW, you may actually get more response on P5's message board (see below), but don't hold your breath. :-(

http://www.standardpascal.com/phpbb/

rug...@gmail.com

unread,
Nov 6, 2012, 6:16:38 PM11/6/12
to
Hi again,

On Wednesday, October 31, 2012 4:50:07 AM UTC-5, Marco van de Voort wrote:
> To have some positive news in this group also, in trunk (v2.7.1) FPC got a
> bit more ISO compatible again.
>
> A first implementation of std-io syntax (description^) was added, and in ISO
> mode other reserved words (like STRING) are hidden.

It still has a ways to go, i.e. needs built-ins get, put, page and correct handling of input^ and auto-assigning files to real filenames.

But yes, an improvement is an improvement. (And don't worry, I won't get my hopes up.)

> I tried to compile P5, and now it bombs on instantation of specific variants
> of variable (case) records with new().

As mentioned, this isn't a total dealbreaker. Here's a small sed patch to (mostly but not completely) work around that for pcom.pas. There's still input^ errors, but the other day I (think I) temporarily fixed that, but it still didn't work correctly, so there are more hidden bugs. Still, it's a good start, even if just for larks.

I still wish to correctly build p5 for FreeDOS (presumably with GPC) one of these days, but I need to double-check the ISO tests and try again (1.1 or 1.2-pre from SVN, dunno, some minor nits on the latter, both probably need major .BAT cleanups). Though it's very low priority, I suppose.

# sed script by rugxulo
# Tuesday, November 6, 2012
#
# tested with pcom.pas 1.1 and fpc 2.7.1-pre (go32v2) from trunk
#
# FreeDOS kernel 2041, FreeCOM 0.84-pre2 XMS_Swap,
# (XMSv3) XMGR 2012-10-15, (DPMI 0.90+) CWSDPMI r7
#
# ppc386 -iD = 2012/03/10, -iW = 2.7.1, -iTO = go32v2, -iTP = i386
#
# C:\TMP> ppc386 -Furtl/units/go32v2 -Se20 pcom.pas
#
# (N.B. there are still bugs, so this won't compile or work just yet)

# pcom.pas(237,7) Error: GOTO and LABEL are not supported \
# (use switch -Sg)
#
# "label 99; { terminate immediately }"
s/(\*\$.*/{$mode iso}/

# pcom.pas(1288,9) Fatal: Syntax error, "BEGIN" expected \
# but "STRING" found
#
# (FPC doesn't let "string" be used as variable name in ISO mode)
#
# [var] "string: csstr;"
s/string/stryng/g

# pcom.pas(1393,28) Error: Pointer to object expected
#
# "new(lvp,reel);" (ISO: make smallest union; TP: call constructor)
#
# (yikes!) pcom.pas line 2658: "new(lcp,proc,declared,formal);"

s/\(new([^,]\+\),[^)]\+\();*\)/\1\2/g

# EOF
0 new messages