Examples of using Metaprogramming in English and their translations into Portuguese
{-}
-
Colloquial
-
Official
-
Medicine
-
Financial
-
Ecclesiastic
-
Ecclesiastic
-
Computer
-
Official/political
Lisp-like macros and other metaprogramming facilities.
Metaprogramming usually works in one of three ways.
Fields of study about such systems are generative programming and metaprogramming.
Metaprogramming is the process of using code to write code.
At this point, the language can benefit from the advantages of metaprogramming.
Generic programming invokes a metaprogramming facility within a language, in those languages supporting it.
Note: quote, alias, use,require are a macro used when we work with metaprogramming.
The first step to metaprogramming is understanding how expressions are represented.
It is important to remember that macros, like all metaprogramming, should be used sparingly.
Metaprogramming is a technique of writing programs that generate or manipulate other programs.
Factor is dynamically typed and has automatic memory management,as well as powerful metaprogramming features.
A word of caution: Metaprogramming is tricky and should only be used when necessary.
Boost has been a sourceof extensive work and research into generic programming and metaprogramming in C.
A common technique for fixing structural duplication uses metaprogramming to encapsulate the repeated structure in a single place.
New instances of classes are constructed by calling the class(for example, SpamClass() or EggsClass()), andthe classes are instances of the metaclass type(itself an instance of itself), allowing metaprogramming and reflection.
Here, codice_9 is an example of metaprogramming in Ruby: codice_70 defines getter and setter methods of instance variables, but codice_9 only getter methods.
The symbolic character of the Wolfram Language-and its integration of computable documents-makes it an ideal choice for metaprogramming and symbolic code manipulation.
Here, attr_reader is an example of metaprogramming in Ruby: attr_accessor defines getter and setter methods of instance variables, but attr_reader only getter methods.
Elixir does indeed support advanced features not natively available in Erlang such as polymorphism through dynamic dispatch, actors, high-order functions,pattern matching, metaprogramming, etc.
Templates in C++ may also be used for template metaprogramming, which is a way of pre-evaluating some of the code at compile-time rather than run-time.
Metaprogramming===F allows some forms of syntax customization to support embedding custom domain-specific languages within the F language itself, particularly through computation expressions.
Because C++ templates are type-aware and Turing-complete, they can also be used to let the compiler resolve recursive conditionals andgenerate substantial programs through template metaprogramming.
This is where Elixir brings a lot of useful features,both in the language(e.g. metaprogramming via macros, and polymorphism via protocols) and in the tooling department(e.g. mix tool for building projects, and hex package manager), allowing us to focus more on the actual problem we're solving.
The need for boilerplate can be reduced through high-level mechanisms such as metaprogramming(which has the computer automatically write the needed boilerplate code or insert it at compile time), convention over configuration(which provides good default values, reducing the need to specify program details in every project) and model-driven engineering which uses models and model-to-code generators, eliminating the need for boilerplate manual code.