Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Everything Is References

Name: Anonymous 2010-08-20 16:29

Is there a language in which variables, function arguments, etc, are always references by default?

For example:

int x = 5;
int y = x;
y++;  // x and y are both 6


If you really did want a copy of something, you'd have to use a keyword:

int x = 5;
int y = copy(x);


And pass-by-value would also have to be done explicitly:

void func(int z)
{
   int w = copy(z); // now w is effectively "local"
}


It would force programmers to at least be aware of the fact that they're making a copy.

Name: Anonymous 2010-08-21 11:47

>>20
it's to make bad programmers aware that they're copying values instead of references — which is retarded
Sorry, but making bad programmers aware of bad programming is hardly "retarded" as a goal of a programming language.

it also makes literals and variable names have totally different semantics, when they should obviously be interchangeable
The fuck are you talking about?  So, what you want is this?

int x = 5;
int 6 = y;

I think you might be a good candidate for a language targeted at "bad programmers."

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List