🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3466

Re: Algol68

#3466
From: Bjorn Danielsson
Date: Fri, 12 Apr 1991 15:40
37 lines
1839 bytes
In article <812@taniwha.UUCP> paul@taniwha.UUCP (Paul Campbell) writes:
>In article <chl.671105965@m1> chl@cs.man.ac.uk (Charles Lindsey) writes:
>> [text deleted]
>>The point is that ENCLOSED-clauses cannot be coerced (you can only coerce
>>the things inside them).
>
>OK, I'm beat :-) I finally figured out where this happens - it's really 
>because:
>
>	PRIMARY:: ENCLOSED clause [5D]
>
>rather than:
>
>	PRIMARY:: ENCOLSED clause coercee
>
>(all the other productions in this section end in coercee). 

Yes, Charles Lindsey is of course right, and my explanation was incorrect.
(I knew that collateral clauses couldn't be coerced into unions, but I was
a bit hasty when looking it up in the report -- sorry!)

> [more text deleted]
>So how do you initialise a union with a row display?? Do you have to put
>it in a temporary variable first?? ugh

No, you use a cast, e.g.

        union([]int, struct(int a, b, c)) fred = []int(1,2,3);

A strong (or firm) cast of the appropriate mode may be coerced into a union.

As I remember from playing around with Algol-68 programming, the coercion
rules were much easier to use than to understand...

>Paul Campbell    UUCP: ..!mtxinu!taniwha!paul     AppleLink: CAMPBELL.P
-- 
Bjorn Danielsson, ZYX Sweden AB, +46 (8) 665 32 05, bd@zyx.SE
Technical Details
Message-ID: <1991Apr12.154035.11959@ZYX.SE>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!ucsd!ucbvax!bloom-beacon!eru!hagbard!sunic!zyx!bd
References: <9168@castle.ed.ac.uk> <4202@zaphod.UUCP> <801@taniwha.UUCP> <4217@zaphod.UUCP> <809@taniwha.UUCP> <chl.671105965@m1> <812@taniwha.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!ucsd!ucbvax!bloom-beacon!eru!hagbard!sunic!zyx!bd
From: bd@ZYX.SE (Bjorn Danielsson)
Newsgroups: comp.lang.misc
Subject: Re: Algol68
Message-ID: <1991Apr12.154035.11959@ZYX.SE>
Date: 12 Apr 91 15:40:35 GMT
References: <9168@castle.ed.ac.uk> <4202@zaphod.UUCP> <801@taniwha.UUCP> <4217@zaphod.UUCP> <809@taniwha.UUCP> <chl.671105965@m1> <812@taniwha.UUCP>
Organization: ZYX Sweden AB, Stockholm, Sweden
Lines: 37