What Are the Two Functions of DMAP?

Save

The "dmap" function is an equation in Cinnameg, a programming language for creating algorithms from functions. The "dmap" function produces a mapped list of elements where each element receives the same functional attribute. Cinnameg uses many function equations to build algorithms. The word "dmap" means "dynamic mapped list."

Cinnameg

  • The Cinnameg programming language supports simple algorithm presentations for computing students. Cinnameg supports declarative, functional approaches, imperative approaches, logic programming, classes and objects, and concurrency. These different algorithms can be integrated within Cinnameg. Rather than providing an extensive library for every algorithm the programmer needs, Cinnameg is a framework for formulating general purpose algorithms. Cinnameg does not limit algorithm formulating to the common object-oriented programming.

Cinnameg Functions

  • To formulate algorithms, Cinnameg uses functions and functional components. Functions are written out using equations, and the equations strung together build the algorithm. The Cinnameg programming language uses tags such as "Define" or "If" to begin the equation. The same tag is preceded by a percent sign at the end of the function. For more complex equations with more than one function, the tag "case" is used within the tag brackets.

Mapping Lists

  • The "dmap" function is a list mapping function in Cinnameg. Mapping a list in Cinnameg is different from building a list. Building a list is using functions to create a list. Mapping a list is applying functions to each element in a list. In Cinnameg, list elements are called members. Other list functions include sorting the members of a list, counting list members, searching a list's members and merging lists. Some functions, including "dmap," generate a dynamic list. Dynamic lists define the same function parameters to each member of the list.

dmap Function Equation

  • The "dmap" function equation is made up of two functional components and is written out as "dmap f [a, b, c] = [f(a), f(b), f(c)]" without the quotes.
    The first component of "dmap f [a, b, c]" is the list function, where "a, b, c" are the members of the list. The second component of "[f(a), f(b), f(c)]" applies the same function to each member of the list. The function "dmap" is shorthand for "dynamic mapped list," which means that the mapped list is dynamic.

References

Promoted By Zergnet

Comments

Resources

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

M
Is DIY in your DNA? Become part of our maker community.
Submit Your Work!