If you are completely lost, let's try to make it a bit simpler through defininga few constants that will than make the instruction shorter:

constant P1 Pointer:Intconstant P2 Pointer:P1constant P3 Pointer:P2

Now the instruction can be:

(addressof P3 d) map Address := addressof P2 c

which says, get the address of 'd' as a level 3 pointer, and assume that it ismapping an Address (a pointer is always an address in facts), and set thisaddress with the address of 'c' as a level 2 pointer.

Message posted by maybe Johan Boulé on2001/01/27 00:44:52

Well, I'll have to think about that a long time before getting used to it.Surprisingly, I feel the Pliant syntax for Pointers is even harder than the C one !

I thought that the ':>' and ':>>' metas were defined recursively until the left member's Type shall match the rigth member's one...

but with this implementation, there would be no diference between :> and :>>

What surprised me is that:

gvar Int i gvar Pointer:Int j k j :> i k :> j

leads to different live code: (C syntax)

j = &i k = j

But maybe it's the same live code generation,since k = j could be implemented as k = &(*j) (pointers automatically dereferenced)?

Message posted by hubert.tonneau on2001/01/27 00:56:54

Exactly: the default behaviour is automatic pointer dereferencing, andbelieve me, it's the good one, but you might need a bit of time to getused to it.

You can think about it the other way round:In Pliant, when you use ':=' you are copying datas,and when you use ':>' you are setting a pointer.

Message posted by pom on2001/01/27 02:22:08

The fundamental difference with C is that you go from the object.
You may see a Pointer like a C reference which you may change.
gvar Pointer:Int p :> q means int &p = q, which
means you refer the int value, independently of the fact that
q shall be an int or an int &.

Hence, Pointer:Int is something like int & and
Pointer Pointer:Int something like (int &) & if such a
thing could exist in C.

I will try to make all this stuff a bit more clear for the talk at ASPIC
(where I hope you could come) and after I will try to have a "publishable"
version for Pliant Journal.