Questions tagged [language-extension]

This tag is used for documented features of a compiler or interpreter implementation that are not described by the language standard, as well as for the implementation of such features, and for the provision of language features (e. g. syntax highlighting) in an IDE.

48 questions
12
votes
1 answer

ViewPatterns and multiple calls in Haskell

I read this: http://hackage.haskell.org/trac/ghc/wiki/ViewPatterns I like the idea, want to use the extension. I however would like to make sure as to one thing: whether the view function is evaluated once for a single matching. So let's say we…
julx
  • 8,694
  • 6
  • 47
  • 86
12
votes
7 answers

How to (computed) goto and longjmp in C++?

I don't usually code C++, but a strange comp sci friend of mine got sick of looking at my wonderful FORTRAN programs and challenged me to rewrite one of them in C++, since he likes my C++ codes better. (We're betting money here.) Exact terms being…
Code Maker
  • 145
  • 1
  • 6
11
votes
1 answer

What is __argvalue?

Also, there is one other thing that is an lvalue in VC#, though it's a language extension - __argvalue(). Source That was the only Google result for __argvalue. I tried it in LINQPad and it doesn't seem to exist.
SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
9
votes
1 answer

OverloadedLists extension not working

The OverloadedLists language pragma in GHC 7.8 is quite attractive, so I decided to try it: {-# LANGUAGE OverloadedLists #-} import Data.Set (Set) import qualified Data.Set as…
Colin Woodbury
  • 1,799
  • 2
  • 15
  • 25
8
votes
4 answers

What GNU C extensions are available that aren't trivial to implement in C99?

How come the Linux kernel can compile only with GCC? What GNU C extensions are really necessary for some projects and why?
Yktula
  • 14,179
  • 14
  • 48
  • 71
8
votes
1 answer

MSVC direct constructor call extension

In this response, tloveless pointed out that it's possible in MSVC to use this->foo::foo(42); for constructor delegation to directly call a constructor: #include struct foo { int m; foo(int p) : m(p) { std::cout <<…
dyp
  • 38,334
  • 13
  • 112
  • 177
8
votes
1 answer

What language extensions does the MTL library require?

I'm trying to understand monad transformers by implementing my own tiny library based on the designs of existing ones. What I'm stuck on is the language extensions. In MonadError, the only extension mentioned is UndecidableInstances. However, I…
Matt Fenwick
  • 48,199
  • 22
  • 128
  • 192
7
votes
2 answers

Convention for specifying extensions in cabalized project

For any .hs file, you can specify the language extensions you rely on like so: {-# LANGUAGE Foo, Bar, Baz #-} A cabalized project can also specify language extensions on a per-project basis in the .cabal file: extensions: Foo, Bar, Baz Which of…
Dan Burton
  • 53,238
  • 27
  • 117
  • 198
7
votes
3 answers

In what cases does NegativeLiterals change behavior?

While describing the NegativeLiterals School of Haskell shows an example of how using the language extension might change the performance of some code and then says Other examples might actually change behavior rather than simply be less…
Wheat Wizard
  • 3,982
  • 14
  • 34
7
votes
1 answer

Haskell pragmas: OPTIONS_GHC vs LANGUAGE

I find myself using this sort of pragma a lot in my cabal projects to force GHC to build with specific options: {-# OPTIONS_GHC -XFlexibleInstances -XRankNTypes ... #-} But when I see other people using extentions, they always declare it in this…
AJF
  • 11,767
  • 2
  • 37
  • 64
6
votes
2 answers

Is there a GHC extension for enabling overloaded character literals?

I am aware that there is a GHC extension, OverloadedStrings, which allows string literals (delimited by ") to become polymorphic, similar to the built-in behavior for number literals. My question is: is there a GHC extension that allows single…
jbweston
  • 105
  • 5
6
votes
3 answers

C++1z Coroutines a language feature?

Why will coroutines (as of now in the newest drafts for C++1z) be implemented as a core language feature (fancy keywords and all) as opposed to a library extension? There already exist a couple of implementations for them (Boost.Coroutine, etc),…
Lazarus535
  • 1,158
  • 1
  • 8
  • 23
5
votes
1 answer

MultiParamTypeClasses - Why is this type variable ambiguous?

Suppose I define a multi-parameter type class: {-# LANGUAGE MultiParamTypeClasses, AllowAmbiguousTypes, FlexibleContexts, FlexibleInstances #-} class Table a b c where decrement :: a -> a evalutate :: a -> b -> c Then I define a function that…
Eben Kadile
  • 759
  • 4
  • 21
5
votes
0 answers

Method Overloading per address-space qualifiers on 'this' parameter

In C++ using clang++, is it possible to overload a method according to address-space qualifiers on the implicit ‘this’ parameter? If so, what is the syntax? This source suggests that I can place the address-space qualifier after the parameter list…
Nick
  • 51
  • 2
4
votes
0 answers

Casting a JavaCC grammar definition into VSCode syntax highlight?

I'm using the Yahoo's Vespa engine that involves a specific grammar in its configurations files (called SearchDefinition). I have access to the grammar of that configuration language through a JavaCC .jj file (see my issue on Vespa's Github). My…