specifications

Is modifying a value type from within a using statement undefined behavior?

帅比萌擦擦* 提交于 2019-12-03 07:01:34
This one's really an offshoot of this question , but I think it deserves its own answer. According to section 15.13 of the ECMA-334 (on the using statement, below referred to as resource-acquisition ): Local variables declared in a resource-acquisition are read-only, and shall include an initializer. A compile-time error occurs if the embedded statement attempts to modify these local variables (via assignment or the ++ and -- operators) or pass them as ref or out parameters. This seems to explain why the code below is illegal. struct Mutable : IDisposable { public int Field; public void

JVM 10 specification with diffs?

荒凉一梦 提交于 2019-12-03 06:33:47
Does anyone know if there is a version of the Java 10 and JVM 10 specifications with diffs from the previous version available? For Java 8 and Java 9, there were specifications with diffs, and it's very difficult to see what exactly changed otherwise. For differences between Java 9 and Java 10 (18.3), you can download " JSR-000383 Java SE 10 (18.3) Final Release Annex 3 for Evaluation " with the following link: http://download.oracle.com/otndocs/jcp/java_se-10-final-eval-spec/index.html Keep in mind, you must accept the Software License Agreement to download it. This archive contains the

How Java linker works?

痴心易碎 提交于 2019-12-03 06:08:42
问题 I want to know how Java linker works. Specifically, in which order it combines classes, interfaces, packages, methods and etc into jvm-executable format. I have found some information here, but there is not so much information about linking order. 回答1: There is no such thing as a Java "linker". There is, however, the concept of a classloader which - given an array of java byte codes from "somewhere" - can create an internal representation of a Class which can then be used with new etc. In

How to use Ruby MiniTest::Spec with Rails for API integration tests?

▼魔方 西西 提交于 2019-12-03 06:04:36
问题 I'm building an app including a Rails API and want to use Ruby MiniTest::Spec to test. What's a good way to set it up? For example, good directory organization, good way to include files, etc.? I'm using the guidelines in the book Rails 3 In Action which uses RSpec and has a great chapter on APIs. The big change is preferring MiniTest::Spec. 回答1: Answering with what I've found so far in case it's helpful to other developers.... spec/api/items_spec.rb require 'spec_helper' class ItemsSpec <

What's the actual use of the Atomics object in ECMAScript?

為{幸葍}努か 提交于 2019-12-03 05:48:40
The ECMAScript specification defines the Atomics object in the section 24.4 . Among all the global objects this is the more obscure for me since I didn't know about its existence until I didn't read its specification, and also Google hasn't many references to it (or maybe the name is too much generic and everything gets submerged?). According its official definition The Atomics object provides functions that operate indivisibly (atomically) on shared memory array cells as well as functions that let agents wait for and dispatch primitive events So it has the shape of an object with a number of

Is doxygen the (de facto) standard documentation syntax specification? [closed]

非 Y 不嫁゛ 提交于 2019-12-03 05:40:57
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . We all have the good habit of documenting our code, right? Nowadays, in-code documentation itself has a syntax. It's almost like a programming language onto itself. The questions are: What (How many) documentation syntax specifications exist? Is there a standard documentation

When reviewing requirements specification what “deadly sins” need to be addressed? [closed]

家住魔仙堡 提交于 2019-12-03 05:19:47
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 months ago . When reviewing requirements specification (that includes functional, non-functional requirements, constraints etc) however small or large it is what are the "deadly sins" committed by authors to look out for? Please list not more than 7 most essential things (in order of

Java: extending a class and implementing an interface that have the same method

安稳与你 提交于 2019-12-03 01:20:51
Probably the following cannot be done (I am getting a compilation error: "The inherited method A.doSomthing(int) cannot hide the public abstract method in B"): public class A { int doSomthing(int x) { return x; } } public interface B { int doSomthing(int x); } public class C extends A implements B { //trying to override doSomthing... int doSomthing(int x) { return doSomthingElse(x); } } Assuming I am allowed to change neither A nor B, my question is can I somehow define C in such a way that it will inherit from both A and B (suppose that it is required for some framework that C will be both an

I don't understand what a YAML tag is

天大地大妈咪最大 提交于 2019-12-03 01:03:55
I get it on some level, but I have yet to see an example that didn't bring up more questions than answers. http://rhnh.net/2011/01/31/yaml-tutorial # Set.new([1,2]).to_yaml --- !ruby/object:Set hash: 1: true 2: true I get that we're declaring a Set tag. I don't get what the subsequent hash mapping has to do with it. Are we declaring a schema? Can someone show me an example with multiple tag declarations? I've read through the spec: http://yaml.org/spec/1.2/spec.html#id2761292 %TAG ! tag:clarkevans.com,2002: Is this declaring a schema? Is there something else a parser has to do in order to

How can “[” be an operator in the PHP language specification?

*爱你&永不变心* 提交于 2019-12-03 00:55:44
On the http://php.net/manual/en/language.operators.precedence.php webpage, the second highest precedence level contains a left-associative operator called [ . I don't understand that. Is it the [ used to access/modify array entries, as in $myArray[23] ? I cannot imagine any code snippet where we would need to know the "precedence" of it wrt other operators, or where the "associativity" of [ would be useful. This is a very valid question. 1. Precedence in between [...] First there is never an ambiguity to what PHP should evaluate first when looking at the right side of the [ , since the bracket