|
|
|
|||||
|
What is the "proxy" Slice syntax for?
Hi,
I'm finding it difficult to determine exactly what the new "proxy" type syntax in Slice means exactly. Take my burgeoning Pengo example: Code:
module Pengo
{
struct Position
{
short x;
long y;
};
interface GameElement
{
Position getPos();
};
interface Movable extends GameElement
{
void moveUp();
void moveDown();
void moveLeft();
void moveRight();
};
interface Smashable extends GameElement
{
void smash();
};
interface Gettable extends GameElement
{
void get();
};
interface Block extends GameElement
{
};
interface WoodenBlock extends Block
{
};
interface BlockOfIce extends Block, Movable, Smashable, Gettable
{
};
interface PlayerCharacter extends GameElement
{
void pickUp(Gettable* element);
};
interface Penguin extends Movable, PlayerCharacter
{
};
};
Now, I can appreciate that you may just want the syntax to reflect the nature of the argument passing more clearly, to avoid confusion with "pass-by-value" semantics. Unfortunately, "void pickUp(Gettable element)" also compiles in Slice! And, according to "diff", different C++ code is produced for this. The documentation is completely silent on what this "plain" syntax means for interfaces. Perhaps this is not supposed to be allowed at all? If it *is*, what does it mean? |
|
|||||
|
Re: Re: What is the "proxy" Slice syntax for?
Quote:
Some kind of forward reference is definitely needed. Perhaps something briefly outlining that there are also classes that can also implement interfaces, hence the conflict, and that "we'll get to that later in the class section". Then I think the readers brain will just push the question of what the "*" is disambiguating onto their mental stack until later ... Regards, Derek. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Don't "Ice-3.1.1-VC71.msi " include the "slice2java.exe"? | Jason Gao | Help Center | 4 | 10-26-2006 11:23 AM |
| Icepack registry "TimeOut" exception with heavy load | eaglecn | Help Center | 1 | 05-26-2006 12:02 AM |
| "Invalid UTF8 string" when transer chinese chars between cpp server and csharp client | raygo | Help Center | 8 | 03-21-2006 08:34 PM |
| Going from "in" to "out" param, using a class as a union | catalin | Help Center | 1 | 04-05-2004 08:55 AM |
| obtaining a proxy for "this" in a servant | vukicevic | Help Center | 1 | 12-02-2003 03:54 PM |