Questions tagged [language-specifications]

126 questions
3
votes
1 answer

What variable is being referred to here?

class Test { int a; void method() { a = 1; int a = a = 2; a = 3; } } There are lots of as in method. What are they all referring to?
Andy Turner
  • 137,514
  • 11
  • 162
  • 243
3
votes
1 answer

Why is the Java class file format missing constant pool tag 2?

The JVM specification for Java 1.0.2 lists the following constant pool entry types: +-----------------------------+-------+ | Constant Type | Value | +-----------------------------+-------+ | CONSTANT_Class | 7 | |…
0xbe5077ed
  • 4,565
  • 6
  • 35
  • 77
3
votes
2 answers

Why can you import a class with the same name as a nested class?

Consider the following code: import java.util.Calendar; class Demo { class Calendar {} public static void main (String[] args) { // System.out.println(Calendar.DAY_OF_WEEK); // Would be an error. } } This code compiles fine;…
Andy Turner
  • 137,514
  • 11
  • 162
  • 243
3
votes
4 answers

Why is null check performed after argument list evaluation?

According to C# Language Specification 7.4.3 Function member invocation the runtime processing of function member invocation consists of the following steps, where M is instance function member declared in a reference-type, E is the instance…
Andrew Karpov
  • 431
  • 2
  • 7
3
votes
1 answer

What defect report is Sean Parent referring to in his GBC - Implement Complete Types talk

In Sean Parent's talk Goals for Better Coding - implement Complete Types at 44:10-44:50 Sean says something to the effect of If I put this [class with a copy assignment operator that accepts its parameter by value, and also has a move…
SCFrench
  • 8,244
  • 2
  • 31
  • 61
3
votes
1 answer

Is this a typo in the Scala Language Specification on Parameterized Types?

Should U_i not be rather T_i, as shown in the picture below ? The same typo (IMHO) is also here. If it is not a typo, then could someone please tell me where the meaning of T_i is specified ?
jhegedus
  • 20,244
  • 16
  • 99
  • 167
3
votes
1 answer

According to the Scala Language Specification, packages are AnyRef values and have types. How does this make sense?

I am reading through the Scala Language Specification and I have encountered something confusing, namely, the implication that packages are values and they do have types. Here is how I concluded (maybe incorrectly?) this strange fact from the Scala…
jhegedus
  • 20,244
  • 16
  • 99
  • 167
3
votes
1 answer

Does a syntax-rules expression by itself evaluate to a value in Scheme?

In Chibi and CHICKEN, the following syntax-rules expression evaluates to a procedure: (syntax-rules () ((_) #f)) Is this just an artifact of how these particular implementations are written? The Scheme language specs do not seem to call out…
Justin Ethier
  • 131,333
  • 52
  • 229
  • 284
3
votes
0 answers

Is there a language (or language spec) to extract elements from a DAG

I have a problem where I have a huge number of DAGs and I have to visit each DAG, and extract many different sets of items. This may sound a bit abstract so let me use an example. Xpath or JSONPath are languages that specify how i can extract an…
3
votes
1 answer

ACSL specification for a possibly infinite C function

I am trying to specify the behavior of external functions, more precisely, their termination. The ACSL documentation says that the \terminates p; property specifies that if the predicate p holds, then the function is guaranteed to terminate, but…
Anne
  • 1,270
  • 6
  • 15
2
votes
2 answers

Is there a specification or standard for Rust?

Is there a specification or standard for Rust? Kind of like the ECMAScript specification for JavaScript? I found https://github.com/rust-lang/reference, and it says: This document is not normative. It may include details that are specific to rustc…
user584011
  • 41
  • 4
2
votes
3 answers

What part of ECMAScript spec mandates that String type is immutable?

I know that String primitive type in Javascript is immutable, via practice and word of mouth. But what combination of rules in the ECMA-262 makes it so? More specifically, why the second line in the following example silently does nothing? const str…
hijarian
  • 2,159
  • 1
  • 28
  • 34
2
votes
4 answers

is deciding the causality requirements of the java memory model tractable?

The Java Language Specification provides criteria for determining whether a (well-formed) execution satisfies "the causality requirement for the Java memory model". Let's assume that the execution is finite. I'm trying to understand if there's a…
2
votes
3 answers

Can this be legally be done in C++?

Note: the following code is illegal, but a conforming compiler is not required to reject it (and some don't). In a library I'm working with I have a template function declaration for Foo and a template function definition for Bar in…
BCS
  • 75,627
  • 68
  • 187
  • 294
2
votes
1 answer

Java Specification: reads see writes that occur later in the execution order

I'm now reading Java Language Specification. §17.4.5-1 said In this execution, the reads see writes that occur later in the execution order. This may seem counterintuitive, but is allowed by happens-before consistency. Allowing reads to see later…
Dean Xu
  • 4,438
  • 1
  • 17
  • 44
1 2 3
8 9