if I wanted to clone a class, which has a property which is equal to another class, and so on, would it just truncate properties that aren't primitives?
basically if I have a variable and I reference it (e.g. by calling avocad), it is put on the call stack, when it is put on the call stack, it get's a special property saying where it originated from (the variable name), if an operator modifies the item, should it loose that special property?
another question. I want to make a constant modifier for my class, which basically ensures that any modifying function clones the object before modifying it
either 1. I don't allow returning values on functions that modify for constant classes, 2. I return a tuple, or 3. I return the new value, but don't have a reference to the new queue
Yes, but you need to declare it readonly instead of const:
public static readonly string[] Titles = { "German", "Spanish", "Corrects", "Wrongs" };
The reason is that const can only be applied to a field whose value is known at compile-time. The array initializer you've shown is not a constant ...
The title is pretty self-explanatory, isn't it?
Your task is to output the alphabet (the string "abcdefghijklmnopqrstuvwxyz") to STDOUT, using each and every letter of the lowercase alphabet in your program once and only once.
Rules:
Only standard letters of the alphabet from ASCII count as l...
My previous answer was criticised for not drawing a line in a sand, so following some discussion on chat I propose a line.
Executive Summary
A purported programming language should be accepted as such if and only if it is capable of addition of natural numbers and primality testing of natural n...
Copy-on-write (sometimes referred to as "COW"), sometimes referred to as implicit sharing, is an optimization strategy used in computer programming. Copy-on-write stems from the understanding that when multiple separate tasks use initially identical copies of some information (i.e., data stored in computer memory or disk storage), treating it as local data, each task working on its own "copy of the data", that they may occasionally need to modify, then it is not necessary to immediately create separate copies of that information for each task. Instead they can all be given pointers to the same...
why not simply make a new copy, as opposed to updating the references of all of the clones?
actually, Wikipedia disagrees
"Instead they can all be given pointers to the same resource, with the provision that on the first occasion where they need to modify the data, they must first create a local copy on which to perform the modification (the original resource remains unchanged)"