Consider the following Abstract Data Type (using Haskell syntax): data Expr = Literal String | Symbol String | And [Expr] | Or [Expr] In Python, on ...
Consider the following Abstract Data Type (using Haskell syntax): data Expr = Literal String | Symbol String | And [Expr] | Or [Expr] In Python, on ...
. Answers to this question are eligible for a +400 reputation bounty. D ...
The language specification, when introducing Concepts, implicitly disallows type traits to be used in type-constraint contexts in lieu of concepts: ...
I had an assignment for my Programming Language homework which makes us to experiment over the language Lua. One of the aspect of the language we requ ...
I can define a struct type that uses a generic type parameter with a trait bound: struct MyStruct<T: Clone> { field: T, } This prevents m ...
My understanding of closures so far is that they combine "open" functions with their surrounding scope, essentially making them closed expressions. I ...
I'm making an esolang based on a conlang, which rather inevitably involves whitespace-separated words. Contrary to a regular programming language usin ...
[expr.prim.lambda.capture]/7: If an expression potentially references a local entity within a scope in which it is odr-usable, and the expression ...
Is there any particular reason why heterogeneous version of erase in associative containers (std::map, std::unordered_map, std::multimap and std::unor ...
The standard rules: [expr.prim.id.unqual]/nt:unqualified-id: unqualified-id: ... ~ type-name ~ decltype-specifier ... [dcl.type.si ...
I'm writing my own compiler and I'm struggling to implement a module system. Can someone guide me, how should this be done? how other languages tackle ...
While operators like + , - , *... can be overloaded, operators like ?:, ::, . cannot be overloaded. Why is this? ...
The following code is valid Kotlin code: abstract class A { protected lateinit var v: X abstract fun f(): X class SubA : A() { ...
I'm working on a custom interpreter for fun ;) What I have so far is assigning variables, defining and calling functions, arrays, loops, if blocks etc ...
Please look at this code: fun localVarNullSafety1(){ var number: Double? = 3.0 val sum = 2.0 + number // does not compile (Type mismatch: in ...
Hutton's "Programming in Haskell", first edition, says that the concatenation operator ++ could be defined as: (++ ys) = foldr (:) ys This makes lo ...
When learning Idris with Edwin's Type-driven Development with Idris, I read about the unique property of Idris that it's type is a first class constru ...
The following code: Will produce compiler error CS1963. I understand how I can get around so this code doesn't need fixing. My question is: why? E ...
I have the following PEG grammar defined: And the following expressions are all parsed correctly: But any expression that begins with a negative ...
I'm new to functional programming and I've just came across the pattern of dividing lists in head and tail. I have a background in Javascript and Pyt ...