language-specifications Questions

4

Solved

Is it guaranteed that False == 0 and True == 1, in Python (assuming that they are not reassigned by the user)? For instance, is it in any way guaranteed that the following code will always produce ...
Gelasius asked 4/5, 2010 at 9:3

5

Solved

In C/C#/etc. you can tell the compiler that a literal number is not what it appears to be (ie., float instead of double, unsigned long instead of int): var d = 1.0; // double var f = 1.0f; // float...
Sanctus asked 28/4, 2011 at 15:3

2

Solved

While reading go specification "Assignability" section, I tried to execute a couple of examples to get a better understanding of the topic, and now I can't get what am I doing wrong in my code. Ac...
Folksy asked 28/12, 2019 at 0:54

0

I tried to add a new keyword (a new flow statement) to Python, by following this blog post and this PEP. I'm pretty sure I've added what I needed to add to the right places, according to the PEP th...
Cobra asked 14/6, 2019 at 16:17

2

Solved

Examine the following code snippets: Snippet #1 int a=20; int b=30; byte c= (a>b)? 20:30; Error: incompatible types: possible lossy conversion from int to byte byte c= (a>b)? 20:30; Sni...
Egis asked 16/5, 2019 at 7:22

1

Solved

Tuple elements may have side-effects, and some of them may depend on others. Consider this program: fn main() { let mut v = vec![1, 2]; match (v.pop(), v.pop()) { (Some(z), Some(y)) => print...

4

Solved

Prompted by the discussion here The docs suggest some equivalent code for the behaviour of all and any Should the behaviour of the equivalent code be considered part of the definition, or c...
Offer asked 6/2, 2013 at 13:16

6

Solved

I've never posted a question of this nature before, so if it's not proper for SO, just don't hurt my feelings too bad and I'll delete it. In the interest of keeping everything I care about as clos...
Mccluskey asked 25/4, 2011 at 16:45

4

Solved

Consider the following pathological example: class Ideone { static class ArrayList<T> { ArrayList() { System.out.println("!!"); } } static class java { static class util { static cl...
Jaimiejain asked 31/5, 2018 at 22:39

1

Solved

In JLS Sec 8.4.3.6, synchronized methods, it says: class BumpTest { // ... static synchronized void classBump() { classCount++; } } has exactly the same effect as: class BumpTest { // ....
Shahaptian asked 31/10, 2017 at 20:47

1

This is related to my answer to "stream reduction incompatible types". I don't know why what I suggested works, and Holger rightly pressed me on this. But even he doesn't seem to have a clear expla...
Yuki asked 5/7, 2017 at 20:17

3

Solved

I know where to find the C# 5 Language Specification but I cannot find the C# 6 Language Specification anywhere. Where is the C# 6 Language Specification?
Kingcup asked 24/7, 2015 at 18:48

5

Solved

I was wondering why I can not have generic property in non-generic class the way I can have generic methods. I.e.: public interface TestClass { IEnumerable<T> GetAllBy<T>(); //this wo...

1

Accordingly to the section "10.12 Static constructors" of "C# Language Specification. Version 5.0" static constructor can be marked with "extern" modifier and in this case it's said to be an extern...
Criticize asked 15/2, 2017 at 19:55

2

Solved

I stumbled upon an old Java code during work that was implemented years ago by a C programmer, and we couldn't help but do start a discussion whether or not the code - even though it compiles and w...
Mizuki asked 23/11, 2016 at 17:43

2

Solved

I've found several posts on hubFS of people asking if there is, or will be, offline documentation for F#. These posts haven't been answered. So I want to give it a shot and ask the same quest...
Throughput asked 10/6, 2010 at 20:37

4

Solved

int main() { char* str1 = "Tom's cat"; char* str2 = "Tom\'s cat"; } The code can be compiled with VS 2015. I just wonder: Are both of the two ways compliant to the C and/or the C++ standard?...
Continuum asked 21/4, 2016 at 6:44

1

Solved

I was reading the java 8 language specification type inference. It says that List<String> ls = new ArrayList<>() would be first reduced ArrayList<α> -> List<String> ...
Kellerman asked 15/4, 2016 at 4:18

5

Solved

Specification for Java 7 is available on the Oracle site, but I can't find Java 8 specification anywhere, although downloads of beta versions of Java 8 are available on the internet. Do you have ...
Josephus asked 28/6, 2013 at 6:8

13

Solved

Can you add new statements (like print, raise, with) to Python's syntax? Say, to allow.. mystatement "Something" Or, new_if True: print "example" Not so much if you should, but rather if it...
Aluminium asked 18/10, 2008 at 10:47

5

Solved

I've read the HTML5 spec for <command> and found the information on this element very vague. I've tried it out and found that it is not working in Chrome (latest version) and it is working o...
Vevina asked 26/1, 2011 at 1:16

2

Solved

There are two important steps to compiling a LINQ query in C#. The first is transforming LINQ query syntax into a chain of method calls, as described in section 7.16 of the C# language specificatio...
Geraldgeralda asked 5/11, 2014 at 2:28

2

I noticed that the following code compiles and works in VS 2013: let f() = do Console.WriteLine(41) 42 But when looking at the F# 3.0 specification I can't find any mention of do being used th...
Preservative asked 16/7, 2014 at 11:43

5

Solved

What's the difference between those two: use Exception; use \Exception; Or those: use Foo\Bar; use \Foo\Bar; The manual says: Note that for namespaced names (fully qualified namespace nam...
Heptad asked 31/1, 2011 at 9:29

3

Solved

I'm trying to make unordered list of variables in var1 occurs twice and var2 occurs infinite times (Use case in my project is different). The element does not allow me to use maxOccurs. Is there ...
Chromatid asked 2/3, 2010 at 10:15

© 2022 - 2024 — McMap. All rights reserved.