Forum > Suggestions

I do not like ^

<< < (3/6) > >>

Blaazen:

--- Quote ---By the way, i will not be against to change the symbol to point to a value @ ...

--- End quote ---
You cannot replace ^ with @ .
Example:

--- Code: ---VAR W : Word;
    P : ^Word;

BEGIN
   W:=10;
   P:=@W;
   WriteLn(P^);
   W:=30;
   WriteLn(P^);
   P^:=80;
   WriteLn(W);
END.

--- End code ---
Example is taken from here: http://www.friends-of-fpc.org/articles/1040517/b/

Leledumbo:

--- Quote ---By the way, i will not be against to change the symbol to point to a value  @variable  (who, for me, is property of internet) with something like  PtrtoVal(variable).
--- End quote ---
@ is already an "address of" operator, which is read naturally: @ is read "at", so @somevar reads "at somevar" which means the address of somevar. beautifully chosen, IMO.

Fred vS:
@ Blaazen

DeRefPtr(var) :=  ^var;
RefPtr(ptr)  := ptr^ ;
PtrtoVal(var) := @var ;



--- Code: ---VAR W : Word;
    P : DeRefPtr(Word);

BEGIN
   W:=10;
   P:=PtrtoVal(W);
   WriteLn( RefPtr(P));
   W:=30;
   WriteLn(RefPtr(P));
 RefPtr(P):=80;
   WriteLn(W);
END.
--- End code ---

PS : It is for the game, im happy with the existing convention, it is only a idea in the air...

Fred vS:
PS 2 @ Blaazen.

It seams that the comprehension of that symbols are difficult to interpret not only by humans.
All the translator from C to Pascal or Pascal to C that i have tested have problems with negotiation with this symbols while translation...

BigChimp:
You can tell a person is integrated into a programming language when he starts making suggestion about how it should be changed.
You can tell a person has been using the language forever when he says to people making thos suggestions that there's a good reason why the original way was chosen.

Just joking ;)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version