slovodefinícia
higher-order macro
(foldoc)
higher-order macro

A means of expressing certain
higher-order functions in a first-order language, proposed
by Phil Wadler. Higher-order macros cannot be recursive
at the top level but they may contain recursive definitions.
For example, the normal, definition of the map function,

map f [] = []
map f (x:xs) = f x : map f xs

is higher-order because its argument, f, is a function. The
alternative formulation

map f l = map_f l
where
map_f [] = []
map_f (x:xs) = f x : m xs

defines a first-order function, map_f, that is a
specialisation of map in its first argument. This can be
considered a macro because it works purely by textual
substitution, requiring no knowledge about f for its validity.

This is an example of partial evaluation - the call, map f l,
has been partially evaluated to yeild an intermediate result.
This may be useful in optimising compilation or execution,
e.g. if the call to f can be subject to in-lining or when
executing map_f on a long list.

(2018-05-25)
podobné slovodefinícia

Nenašli ste slovo čo ste hľadali ? Doplňte ho do slovníka.

na vytvorenie tejto webstránky bol pužitý dictd server s dátami z sk-spell.sk.cx a z iných voľne dostupných dictd databáz. Ak máte klienta na dictd protokol (napríklad kdict), použite zdroj slovnik.iz.sk a port 2628.

online slovník, sk-spell - slovníkové dáta, IZ Bratislava, Malé Karpaty - turistika, Michal Páleník, správy, údaje o okresoch V4