In order to find myself some nice lapis lazuli and get away from my current base, I'm building a little tunnel in the Nether to allow me to get into the midst of some fresh chunks fairly quickly.
I have a nice little stone house, but as Ghasts and zombie pigmen can spawn at "any light level" in ...
My wife, Lady Gray, is "stuck in a wall" in Fairfax Gardens, our Marital Home. I can't actually see her, but the glowing trail leads me to the guard house (on the left when facing Fairfax manor) when I set my family as my target. Is there any hope?
I've started a new approach. I'm slowly tryi...
I am playing a human wizard, and I just killed a monster, leaving a corpse on the ground. How do I tell whether it is safe to eat this corpse?
I leave the monster unspecified because I am interested in "how can I figure out whether this is edible," rather than whether any particular monster is e...
@sbi Not sure. What I'm saying is that even if they go somewhere else and it's really nice, chances are they'll be discontent simply because it's not America. In other words, even if they travel and move, they'll probably end up being unhappy with anything that differs wildly from America. Same could probably be said of people emigrating from other countries as well.
@LewsTherin. Hard to say. but most of them thinks money money money. fu*k studies, the husband will keep me as a "doll". So if you have money, dont hesitate. Your will get one easily :)
I read a little while ago that Java is not an interpreted language, because that's not a distinction made by the language reference. It's up to the implementation to decide that, and it just so happens that there aren't any implementations of Java that directly compile. Is that true?
I'm sure a language standard could say, "This language must be interpreted/compiled," but is that ever actually done?
@sbi Well, yeah. It's compiled to machine-independent bytecode, which is either interpreted directly or compiled to native assembly at runtime. But you know what I mean.
With a compiled language, code you enter is reduced to a set of machine-specific instructions before being saved as an executable file. With interpreted languages, the code is saved in the same format that you entered. - vanguardsw.com/dphelp4/dph00296.htm
The GC is part of the runtime in all likelihood. As to the tricks a typical D implementation uses for code-generation, I don't know enough about the language to know what's allowed or not.
OCaml is garbage-collected and the reference implementation is compiled and as I understand it it uses (or used to?) tagged types.
Come to think of it, tagging integers isn't that useful for x64, is it?
Encoding some sort of information into the data so that the runtime can identify its type.
IIRC some integer types in the reference OCaml implementation always have the highest order bit set to disambiguate them from pointers.
That way the GC knows not to inspect them.
The 'downside' of that is that that integer type will be e.g. 31 bit wide and not 32 which can make bugs appear in faulty code that wrongfully assumes the type to be 4 bytes.
I'm reading through the dragon book and trying to solve an exercise that is stated as follows
Write regular definitions for the following languages:
All strings of digits with no repeated digits. Hint: Try this problem first with a few digits, such as { 0, 1, 2 }.
Despite having ...
What's the motivation for sentinel-terminated arrays, like C-strings? It takes up the same amount of space as it would if you put an integer with the length before the string itself, but it's less convenient.
@JohannesSchaublitb What about regex doesn't have to do with programming?
The problem with my implementation is that I have no way to decide between types with the same size and same signedness, like say char32_t and int (32-bit on my machine).
So, it's more like a std::guess_underlying_type right now.
@LucDanton Right, that's the problem. If I have enum foo : char32_t {};, my std::underlying_type could return int instead, because it has the same signedness and size.
Since you're starting the thread with no arguments, you expect the task to be started with no arguments, as if task1() were used. Hence the signature that you want to support is not int(int, int) but int(). In turn, this means that you must pass a functor that is compatible with this signature to...
In computer science, a value (from "fully evaluated") is an expression which cannot be evaluated any further (a normal form). The members of a type are the values of that type. For example, the expression "1 + 2" is not a value as it can be reduced to the expression "3". This expression cannot be reduced any further (and is a member of the type Nat) and therefore is a value.
The "value of a variable" is given by the corresponding mapping in the environment. In languages with assignable variables it becomes necessary to distinguish between the R-value (or contents) and the L-value (or loca...
@RMartinhoFernandes That's correct. Strictly speaking, lvalues are not rvalues, but an lvalue can be used where an rvalue needs to be because of lvalue-to-rvalue conversion.
@RMartinhoFernandes Can't source it but I think there's a C++ quote to the effect of "make it behave like it works for int", in the context of e.g. overloaded operators. Point being that it helps writing generic code when everything behaves like int.
Offering no exception safety guarantee should be an option only if your crack team of requirements analysts has identified a need for your application to leak resources and run with corrupt data structures. - Michael Meyers
So I'm really glad that in C++ auto copy = original; does a copy, that there isn't a distinction between 'value' types and 'reference' types shoved down our throats.
@RMartinhoFernandes IIRC when it comes to value types vs reference types but what I showed might just work (i.e. make a copy), D takes care to support generic programming.
In concurrent programming, a monitor is an object or module intended to be used safely by more than one thread. The defining characteristic of a monitor is that its methods are executed with mutual exclusion. That is, at each point in time, at most one thread may be executing any of its methods. This mutual exclusion greatly simplifies reasoning about the implementation of monitors compared to reasoning about parallel code that updates a data structure.
Monitors also provide a mechanism for threads to temporarily give up exclusive access, in order to wait for some condition to be met, befo...
Starting with dmd version 2.030, the default storage class for statics and globals will be thread local storage (TLS), rather than the classic global data segment.
There's also a bunch of ignorant C# programmers that believe the difference is that "value types go on the stack, reference types on the heap", or that "value types are faster".
in c#, there's a whole other dimension...by default, everything is passed by value. passing in a reference type == passing the reference by value. passing by reference effectively means passing the variable itself rather than its value
Hence why formally what we call 'pass-by-reference' is 'pass-a-handle-by-value-in-an-impure-language' some of the time, obviously the second one is not as catchy :)
Wait. So if I define a class Foo - a reference type in D - instantiate an object of it, and pass that object to some function, the function's actions on the object will have effects on code elsewhere?