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
4
votes
1 answer

Language extension using Racket, defining helper functions via macros

I've been stuck with an issue for a number of hours now. I'm trying to define a DSL using Racket's language extension features. I want to do something like the following pseudo-code. Ultimately I'd like to generate functions and macros given the…
RogerTheDragon
  • 267
  • 1
  • 10
3
votes
1 answer

Deriving extensions with multiparameter types

I have an Ast type constructor, parameterized by the identifier type. Using the DeriveFunctor, DeriveFoldable and DeriveTraversable extensions it is possible to automatically create the appropriate instances. Now I find it useful to introduce more…
3
votes
3 answers

What C GNU-isms exist?

I was recently porting a project from GCC to clang(in which I fixed a number of C GNU-isms). This got me thinking: what C GNU-isms(extensions to the C language supported in GCC, which are not standardized) exist? Is there a comprehensive list…
Mike
  • 23,892
  • 18
  • 70
  • 90
3
votes
1 answer

Generating require-clauses with Racket macros

Okay, I must be really daft. I'm trying to create a macro (part of a larger undertaking) that given a function, wraps it in its own submodule, then requires it, so that functions defined thusly cannot mess around with surrounding terms, but that the…
RogerTheDragon
  • 267
  • 1
  • 10
3
votes
1 answer

Haskell TransformListComp extension

I read this guide about haskell language extensions and was somewhat confused by the TransformListComp explanation. I tried to rewrite all the TransformListComp expression without the sugar but I'm not sure if I'm correct. Also I think there is a…
Ingdas
  • 1,446
  • 1
  • 11
  • 21
2
votes
1 answer

Is there a proposal to extend the C++ language so as to obviate pimpl?

Sometimes, you want to provide a class declaration, which is not merely an opaque forward declaration but has the public functionality exposed - yet you don't want to commit to your private, or implementation-specific, fields and methods. One…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
2
votes
2 answers

How to parse a domain-specific language on top of Python? What architecture with IPython?

I want to construct a domain-specific language as a superset of Python. Cryptic commands like f7:10y=x^2 designed to minimize typing shall be parsed into plain Python for k in range(7,10): f[k].set_y( expr='x^2' ) before being executed.…
Joachim W
  • 7,290
  • 5
  • 31
  • 59
1
vote
0 answers

Is there a way to identify if a hover is already open in a vscode extension?

I have a definition provider for my language extension for VSCode which works in giving a go-to link and a preview of the definition when holding down Ctrl and hovering over the text. I would like the hover that is provided when you activate the…
1
vote
3 answers

How can I repeat calling a function until it returns None?

Suppose I have 2 functions Func> FindEmployee It returns an employee if the Id is found, otherwise None; Func> PromptPassword It will open a dialog asking for password, if OK button is hit, it will…
sowen
  • 1,090
  • 9
  • 28
1
vote
1 answer

make cppcheck skip the PACKAGE definition

I'm using the GUI version of cppcheck 1.64 for static code analysis on C++-Builde-6 code. For DLL exports and imports, the definition of PACKAGE is necessary: /// A dialog exported from a BPL (a VCL-specific kind of DLL) class PACKAGE MySharedDialog…
Wolf
  • 9,679
  • 7
  • 62
  • 108
1
vote
2 answers

Haskell Extension Pattern Matching With Type Constraints

Does anyone know of an extension that would allow one to put type constraints on pattern matching? For example: {Language Extension} IsOrderable::(Eq a)=>a->IO Bool IsOrderable x = case x of o::(Ord a=>a) -> do putStrLn…
PyRulez
  • 10,513
  • 10
  • 42
  • 87
0
votes
1 answer

Why does -XImplicitParams work only from the command line, not a pragma?

Why does -XImplicitParams work from the command line but not the OPTIONS_GHC pragma? I've found that ghc t.hs throws a parse error on input 'a' if t.hs contains the following code, while ghc -XImplicitParams t.hs works fine. Ditto ghci. {-…
Jeff Burdges
  • 4,204
  • 23
  • 46
0
votes
0 answers

C# LanguageExt Filter First

I am trying to use the LanguageExt library of C#. I wanted to know how to "Stop" filtering after the first predicate turns true in a set of objects. Example - HashMap with Filter through HashMap to find the FIRST element…
zooes
  • 1,280
  • 3
  • 15
  • 21
0
votes
0 answers

C++ language/library extension with GCC Plugin. Is it possible?

I looked through GCC plugin API and some examples on github (which are basic), and I couldn't find anything that could help me with my question. Suppose that I have a new standard library feature in mind, that can not be implemented with existing…
Sergey Kolesnik
  • 3,009
  • 1
  • 8
  • 28
0
votes
2 answers

defining integral static const in a class whose .h file is included in multiple cpp files

A.h class A { private: static const int b = 50; int c[b]; }; A.cpp #include "A.h" const int A::b; C.cpp #include "A.h" The compiler issues me a warning saying b is defined multiple times and one is ignored. I need to…
ram
  • 63
  • 1
  • 4