Metalang99 1.13.3
Full-blown preprocessor metaprogramming
Loading...
Searching...
No Matches
list.h File Reference

Cons-lists. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ML99_cons(x, xs)   ML99_call(ML99_cons, x, xs)
 Prepends x to xs.
 
#define ML99_nil(...)   ML99_callUneval(ML99_nil, )
 The empty list.
 
#define ML99_isCons(list)   ML99_call(ML99_isCons, list)
 Checks list for non-emptiness.
 
#define ML99_isNil(list)   ML99_call(ML99_isNil, list)
 Checks list for emptiness.
 
#define ML99_listHead(list)   ML99_call(ML99_listHead, list)
 Extracts the head from the non-empty list list.
 
#define ML99_listTail(list)   ML99_call(ML99_listTail, list)
 Extracts the tail from the non-empty list list.
 
#define ML99_listLast(list)   ML99_call(ML99_listLast, list)
 Extracts the last element from the non-empty list list.
 
#define ML99_listInit(list)   ML99_call(ML99_listInit, list)
 Extracts all the elements of the non-empty list list except the last one.
 
#define ML99_list(...)   ML99_call(ML99_list, __VA_ARGS__)
 Constructs a list from its arguments.
 
#define ML99_listFromTuples(f, ...)   ML99_call(ML99_listFromTuples, f, __VA_ARGS__)
 Constructs a list from comma-separated tuples.
 
#define ML99_listFromSeq(seq)   ML99_call(ML99_listFromSeq, seq)
 Constructs a list from the sequence seq.
 
#define ML99_listLen(list)   ML99_call(ML99_listLen, list)
 Computes the length of list.
 
#define ML99_LIST_EVAL(...)   ML99_EVAL(ML99_call(ML99_listUnwrap, __VA_ARGS__))
 Evaluates a metaprogram that reduces to a list, then unwraps it.
 
#define ML99_LIST_EVAL_COMMA_SEP(...)   ML99_EVAL(ML99_call(ML99_listUnwrapCommaSep, __VA_ARGS__))
 The same as ML99_LIST_EVAL but intersperses a comma between list items.
 
#define ML99_listAppend(list, other)   ML99_call(ML99_listAppend, list, other)
 Appends the list other to list.
 
#define ML99_listAppendItem(item, list)   ML99_call(ML99_listAppendItem, item, list)
 Appends the item item to list.
 
#define ML99_listUnwrap(list)   ML99_call(ML99_listUnwrap, list)
 Places all the items in list as-is.
 
#define ML99_listUnwrapCommaSep(list)   ML99_call(ML99_listUnwrapCommaSep, list)
 Places all the items in list as-is, separated by commas.
 
#define ML99_listReverse(list)   ML99_call(ML99_listReverse, list)
 Reverses the order of items in list.
 
#define ML99_listGet(i, list)   ML99_call(ML99_listGet, i, list)
 Extracts the i -indexed element.
 
#define ML99_listFoldr(f, init, list)   ML99_call(ML99_listFoldr, f, init, list)
 A right-associative fold over list.
 
#define ML99_listFoldl(f, init, list)   ML99_call(ML99_listFoldl, f, init, list)
 A left-associative fold over list.
 
#define ML99_listFoldl1(f, list)   ML99_call(ML99_listFoldl1, f, list)
 The same as ML99_listFoldl but treats the first element of list as the initial value.
 
#define ML99_listIntersperse(item, list)   ML99_call(ML99_listIntersperse, item, list)
 Intersperses item between the items in list.
 
#define ML99_listPrependToAll(item, list)   ML99_call(ML99_listPrependToAll, item, list)
 Prepends item to all items in list.
 
#define ML99_listMap(f, list)   ML99_call(ML99_listMap, f, list)
 Maps all the elements in list with f.
 
#define ML99_listMapI(f, list)   ML99_call(ML99_listMapI, f, list)
 The same as ML99_listMap but provides an index of an element to f.
 
#define ML99_listMapInPlace(f, list)   ML99_call(ML99_listMapInPlace, f, list)
 A more efficient version of ML99_listUnwrap(ML99_listMap(f, list)).
 
#define ML99_listMapInPlaceI(f, list)   ML99_call(ML99_listMapInPlaceI, f, list)
 A more efficient version of ML99_listUnwrap(ML99_listMapI(f, list)).
 
#define ML99_listFor(list, f)   ML99_call(ML99_listFor, list, f)
 The same as ML99_listMap but with the reversed order of arguments.
 
#define ML99_listMapInitLast(f_init, f_last, list)    ML99_call(ML99_listMapInitLast, f_init, f_last, list)
 Maps the initial elements of the non-empty list list with f_init and the last element with f_last.
 
#define ML99_listForInitLast(list, f_init, f_last)    ML99_call(ML99_listForInitLast, list, f_init, f_last)
 The same as ML99_listMapInitLast but accepts list as the first parameter.
 
#define ML99_listFilter(f, list)   ML99_call(ML99_listFilter, f, list)
 Filters list with f.
 
#define ML99_listFilterMap(f, list)   ML99_call(ML99_listFilterMap, f, list)
 A combination of ML99_listFilter and ML99_listMap.
 
#define ML99_listEq(cmp, list, other)   ML99_call(ML99_listEq, cmp, list, other)
 Tests list and other for equality.
 
#define ML99_listContains(cmp, item, list)   ML99_call(ML99_listContains, cmp, item, list)
 Checks whether item resides in list.
 
#define ML99_listTake(n, list)   ML99_call(ML99_listTake, n, list)
 Extracts the prefix of list of the length n.
 
#define ML99_listTakeWhile(f, list)   ML99_call(ML99_listTakeWhile, f, list)
 Extracts the items from list as long as f evaluates to ML99_true().
 
#define ML99_listDrop(n, list)   ML99_call(ML99_listDrop, n, list)
 Removes the prefix of list of the length n.
 
#define ML99_listDropWhile(f, list)   ML99_call(ML99_listDropWhile, f, list)
 Removes the items from list as long as f evaluates to ML99_true().
 
#define ML99_listZip(list, other)   ML99_call(ML99_listZip, list, other)
 Computes a list of two-place tuples of the corresponding items from list and other.
 
#define ML99_listUnzip(list)   ML99_call(ML99_listUnzip, list)
 Transforms a list of two-place tuples into a tuple of a list of the first components and a list of the second components.
 
#define ML99_listReplicate(n, item)   ML99_call(ML99_listReplicate, n, item)
 Computes a list of length n with each element item.
 
#define ML99_listPartition(f, list)   ML99_call(ML99_listPartition, f, list)
 Returns a two-place tuple of lists: those items of list the do and do not satisfy the predicate f, respectively.
 
#define ML99_listAppl(f, list)   ML99_call(ML99_listAppl, f, list)
 Applies all the items in list to f.
 
#define ML99_CONS(x, xs)   ML99_CHOICE(cons, x, xs)
 
#define ML99_NIL(...)   ML99_CHOICE(nil, ~)
 
#define ML99_IS_CONS(list)   ML99_NOT(ML99_IS_NIL(list))
 
#define ML99_IS_NIL(list)   ML99_PRIV_IS_NIL(list)
 

Detailed Description

Cons-lists.

Macro Definition Documentation

◆ ML99_cons

#define ML99_cons (   x,
  xs 
)    ML99_call(ML99_cons, x, xs)

Prepends x to xs.

Examples

#define v(...)
A value that is pasted as-is; no evaluation occurs on provided arguments.
Definition lang.h:145
Cons-lists.
#define ML99_cons(x, xs)
Prepends x to xs.
Definition list.h:30
#define ML99_nil(...)
The empty list.
Definition list.h:35

◆ ML99_isCons

#define ML99_isCons (   list)    ML99_call(ML99_isCons, list)

Checks list for non-emptiness.

Examples

// 1
// 0
#define ML99_list(...)
Constructs a list from its arguments.
Definition list.h:147
#define ML99_isCons(list)
Checks list for non-emptiness.
Definition list.h:52

◆ ML99_isNil

#define ML99_isNil (   list)    ML99_call(ML99_isNil, list)

Checks list for emptiness.

Examples

// 0
// 1
#define ML99_isNil(list)
Checks list for emptiness.
Definition list.h:69

◆ ML99_list

#define ML99_list (   ...)    ML99_call(ML99_list, __VA_ARGS__)

Constructs a list from its arguments.

At most 63 arguments are acceptable.

Examples

// 1, 2, 3
ML99_list(v(1, 2, 3))

◆ ML99_LIST_EVAL

#define ML99_LIST_EVAL (   ...)    ML99_EVAL(ML99_call(ML99_listUnwrap, __VA_ARGS__))

Evaluates a metaprogram that reduces to a list, then unwraps it.

It behaves the same as the composition of ML99_EVAL and ML99_listUnwrap.

Examples

// Literally 1 2 3
#define ML99_LIST_EVAL(...)
Evaluates a metaprogram that reduces to a list, then unwraps it.
Definition list.h:224
Note
This macro does not result in a Metalang99 term; it literally pastes list elements into a source file.

◆ ML99_LIST_EVAL_COMMA_SEP

#define ML99_LIST_EVAL_COMMA_SEP (   ...)    ML99_EVAL(ML99_call(ML99_listUnwrapCommaSep, __VA_ARGS__))

The same as ML99_LIST_EVAL but intersperses a comma between list items.

Examples

// Literally 1, 2, 3
#define ML99_LIST_EVAL_COMMA_SEP(...)
The same as ML99_LIST_EVAL but intersperses a comma between list items.
Definition list.h:241
Utilitary stuff.
Note
This macro does not result in a Metalang99 term; it literally pastes comma-separated list elements into a source file.

◆ ML99_listAppend

#define ML99_listAppend (   list,
  other 
)    ML99_call(ML99_listAppend, list, other)

Appends the list other to list.

Examples

// 1, 2, 3
#define ML99_listAppend(list, other)
Appends the list other to list.
Definition list.h:255

◆ ML99_listAppendItem

#define ML99_listAppendItem (   item,
  list 
)    ML99_call(ML99_listAppendItem, item, list)

Appends the item item to list.

Examples

// 1, 2, 3
#define ML99_listAppendItem(item, list)
Appends the item item to list.
Definition list.h:269

◆ ML99_listAppl

#define ML99_listAppl (   f,
  list 
)    ML99_call(ML99_listAppl, f, list)

Applies all the items in list to f.

If the list is empty, results in f as-is.

Examples

#include <metalang99/nat.h>
// ML99_add
// ML99_appl(v(ML99_add), v(1))
// ML99_appl2(v(ML99_add), v(1), v(2))
#define ML99_listAppl(f, list)
Applies all the items in list to f.
Definition list.h:722
Natural numbers: [0; 255].
#define ML99_add(x, y)
Definition nat.h:211

◆ ML99_listContains

#define ML99_listContains (   cmp,
  item,
  list 
)    ML99_call(ML99_listContains, cmp, item, list)

Checks whether item resides in list.

Examples

#include <metalang99/nat.h>
// 1
// 0
#define ML99_listContains(cmp, item, list)
Checks whether item resides in list.
Definition list.h:576
#define ML99_natEq(x, y)
Definition nat.h:112

◆ ML99_listDrop

#define ML99_listDrop (   n,
  list 
)    ML99_call(ML99_listDrop, n, list)

Removes the prefix of list of the length n.

If n is greater than the length of list, ML99_nil() is returned.

Examples

// 2, 3
ML99_listDrop(v(1), ML99_list(v(1, 2, 3)))
#define ML99_listDrop(n, list)
Removes the prefix of list of the length n.
Definition list.h:621

◆ ML99_listDropWhile

#define ML99_listDropWhile (   f,
  list 
)    ML99_call(ML99_listDropWhile, f, list)

Removes the items from list as long as f evaluates to ML99_true().

Examples

#include <metalang99/nat.h>
// 4, 5, 6
#define ML99_appl(f,...)
Applies arguments to f.
Definition lang.h:93
#define ML99_listDropWhile(f, list)
Removes the items from list as long as f evaluates to ML99_true().
Definition list.h:636
#define ML99_lesser(x, y)
Definition nat.h:180

◆ ML99_listEq

#define ML99_listEq (   cmp,
  list,
  other 
)    ML99_call(ML99_listEq, cmp, list, other)

Tests list and other for equality.

Examples

#include <metalang99/nat.h>
// 0
ML99_listEq(v(ML99_natEq), ML99_list(v(1, 2, 3)), ML99_list(v(4, 5, 6)))
// 1
ML99_listEq(v(ML99_natEq), ML99_list(v(1, 2, 3)), ML99_list(v(1, 2, 3)))
#define ML99_listEq(cmp, list, other)
Tests list and other for equality.
Definition list.h:558

◆ ML99_listFilter

#define ML99_listFilter (   f,
  list 
)    ML99_call(ML99_listFilter, f, list)

Filters list with f.

Examples

#include <metalang99/nat.h>
// 9, 11, 6
ML99_listFilter(ML99_appl(v(ML99_lesser), v(5)), ML99_list(v(9, 1, 11, 6, 0, 4)))
#define ML99_listFilter(f, list)
Filters list with f.
Definition list.h:520

◆ ML99_listFilterMap

#define ML99_listFilterMap (   f,
  list 
)    ML99_call(ML99_listFilterMap, f, list)

A combination of ML99_listFilter and ML99_listMap.

It builds a new list by applying f to each element in list: if f yields ML99_just(x), x is passed to the new list, otherwise (ML99_nothing()), the value is neglected.

Examples

#define MAYBE_LIST ML99_list(ML99_just(v(5)), ML99_nothing(), ML99_just(v(7)))
// 5, 7
#define ML99_listFilterMap(f, list)
A combination of ML99_listFilter and ML99_listMap.
Definition list.h:540
An optional value.
#define ML99_id(...)
Evaluates to its arguments.
Definition util.h:96

◆ ML99_listFoldl

#define ML99_listFoldl (   f,
  init,
  list 
)    ML99_call(ML99_listFoldl, f, init, list)

A left-associative fold over list.

Examples

#define ABCDEFG 123
// 7
// 123
ML99_listFoldl(v(ML99_cat), v(A), ML99_list(v(BC, DEF, G)))
#define ML99_listFoldl(f, init, list)
A left-associative fold over list.
Definition list.h:371
#define ML99_cat(a, b)
Concatenates a with b, leaving the result unevaluated.
Definition util.h:53

◆ ML99_listFoldl1

#define ML99_listFoldl1 (   f,
  list 
)    ML99_call(ML99_listFoldl1, f, list)

The same as ML99_listFoldl but treats the first element of list as the initial value.

Examples

#define ABCDEFG 123
// 123
#define ML99_listFoldl1(f, list)
The same as ML99_listFoldl but treats the first element of list as the initial value.
Definition list.h:387

◆ ML99_listFoldr

#define ML99_listFoldr (   f,
  init,
  list 
)    ML99_call(ML99_listFoldr, f, init, list)

A right-associative fold over list.

Examples

#define ABCDEFG 123
// 7
// 123
#define ML99_listFoldr(f, init, list)
A right-associative fold over list.
Definition list.h:352
#define ML99_flip(f)
Reverses the order of arguments of the binary function f.
Definition util.h:124

◆ ML99_listFor

#define ML99_listFor (   list,
 
)    ML99_call(ML99_listFor, list, f)

The same as ML99_listMap but with the reversed order of arguments.

Examples

#include <metalang99/nat.h>
// 4, 5, 6
#define ML99_listFor(list, f)
The same as ML99_listMap but with the reversed order of arguments.
Definition list.h:476

◆ ML99_listForInitLast

#define ML99_listForInitLast (   list,
  f_init,
  f_last 
)     ML99_call(ML99_listForInitLast, list, f_init, f_last)

The same as ML99_listMapInitLast but accepts list as the first parameter.

Examples

// 4, 5, 10
v(7)))
#define ML99_listForInitLast(list, f_init, f_last)
The same as ML99_listMapInitLast but accepts list as the first parameter.
Definition list.h:504

◆ ML99_listFromSeq

#define ML99_listFromSeq (   seq)    ML99_call(ML99_listFromSeq, seq)

Constructs a list from the sequence seq.

Examples

// ML99_nil()
// ML99_list(v(1, 2, 3))
ML99_listFromSeq(v((1)(2)(3)))
#define ML99_listFromSeq(seq)
Constructs a list from the sequence seq.
Definition list.h:188

◆ ML99_listFromTuples

#define ML99_listFromTuples (   f,
  ... 
)    ML99_call(ML99_listFromTuples, f, __VA_ARGS__)

Constructs a list from comma-separated tuples.

It sequentially applies f to each untupled argument, thus forming the resulting list. If some argument is not a tuple, a fatal error is emitted.

The result is ML99_list(ML99_appl(f, ML99_untuple(x1)), ..., ML99_appl(f, ML99_untuple(xN))).

Each variadic argument inherits all the preconditions of ML99_isUntuple.

Examples

#define F_IMPL(x, y) v(x + y)
#define F_ARITY 1
// ML99_list(v(1 + 2, 3 + 4, 5 + 6))
ML99_listFromTuples(v(F), v((1, 2), (3, 4), (5, 6)))
#define ML99_listFromTuples(f,...)
Constructs a list from comma-separated tuples.
Definition list.h:171

◆ ML99_listGet

#define ML99_listGet (   i,
  list 
)    ML99_call(ML99_listGet, i, list)

Extracts the i -indexed element.

Examples

// 2
ML99_listGet(v(1), ML99_list(v(1, 2, 3)))
#define ML99_listGet(i, list)
Extracts the i -indexed element.
Definition list.h:333

◆ ML99_listHead

#define ML99_listHead (   list)    ML99_call(ML99_listHead, list)

Extracts the head from the non-empty list list.

Examples

// 1
#define ML99_listHead(list)
Extracts the head from the non-empty list list.
Definition list.h:83

◆ ML99_listInit

#define ML99_listInit (   list)    ML99_call(ML99_listInit, list)

Extracts all the elements of the non-empty list list except the last one.

Examples

// 1, 2
// ML99_nil()
#define ML99_listInit(list)
Extracts all the elements of the non-empty list list except the last one.
Definition list.h:131

◆ ML99_listIntersperse

#define ML99_listIntersperse (   item,
  list 
)    ML99_call(ML99_listIntersperse, item, list)

Intersperses item between the items in list.

Examples

// 1, +, 2, +, 3
#define ML99_listIntersperse(item, list)
Intersperses item between the items in list.
Definition list.h:401

◆ ML99_listLast

#define ML99_listLast (   list)    ML99_call(ML99_listLast, list)

Extracts the last element from the non-empty list list.

Examples

// 3
#define ML99_listLast(list)
Extracts the last element from the non-empty list list.
Definition list.h:114

◆ ML99_listLen

#define ML99_listLen (   list)    ML99_call(ML99_listLen, list)

Computes the length of list.

Examples

// 0
// 3
#define ML99_listLen(list)
Computes the length of list.
Definition list.h:205

◆ ML99_listMap

#define ML99_listMap (   f,
  list 
)    ML99_call(ML99_listMap, f, list)

Maps all the elements in list with f.

Examples

#include <metalang99/nat.h>
// 4, 5, 6
#define ML99_listMap(f, list)
Maps all the elements in list with f.
Definition list.h:430

◆ ML99_listMapI

#define ML99_listMapI (   f,
  list 
)    ML99_call(ML99_listMapI, f, list)

The same as ML99_listMap but provides an index of an element to f.

Examples

#define F_IMPL(x, i) v(x[i])
#define F_ARITY 2
// a[0], b[1], c[2]
ML99_listMapI(v(F), ML99_list(v(a, b, c)))
#define ML99_listMapI(f, list)
The same as ML99_listMap but provides an index of an element to f.
Definition list.h:447

◆ ML99_listMapInitLast

#define ML99_listMapInitLast (   f_init,
  f_last,
  list 
)     ML99_call(ML99_listMapInitLast, f_init, f_last, list)

Maps the initial elements of the non-empty list list with f_init and the last element with f_last.

Examples

// 4, 5, 10
2, 3)))
#define ML99_listMapInitLast(f_init, f_last, list)
Maps the initial elements of the non-empty list list with f_init and the last element with f_last.
Definition list.h:490

◆ ML99_listMapInPlace

#define ML99_listMapInPlace (   f,
  list 
)    ML99_call(ML99_listMapInPlace, f, list)

A more efficient version of ML99_listUnwrap(ML99_listMap(f, list)).

Note
Unlike ML99_listMap, f can evaluate to many terms.

◆ ML99_listMapInPlaceI

#define ML99_listMapInPlaceI (   f,
  list 
)    ML99_call(ML99_listMapInPlaceI, f, list)

A more efficient version of ML99_listUnwrap(ML99_listMapI(f, list)).

Note
Unlike ML99_listMapI, f can evaluate to many terms.

◆ ML99_listPartition

#define ML99_listPartition (   f,
  list 
)    ML99_call(ML99_listPartition, f, list)

Returns a two-place tuple of lists: those items of list the do and do not satisfy the predicate f, respectively.

Examples

#include <metalang99/nat.h>
// ML99_tuple(ML99_list(v(4, 7)), ML99_list(v(11, 12, 13)))
ML99_listPartition(ML99_appl(v(ML99_greater), v(10)), ML99_list(v(11, 4, 12, 13, 7)))
#define ML99_listPartition(f, list)
Returns a two-place tuple of lists: those items of list the do and do not satisfy the predicate f,...
Definition list.h:699
#define ML99_greater(x, y)
Definition nat.h:146

◆ ML99_listPrependToAll

#define ML99_listPrependToAll (   item,
  list 
)    ML99_call(ML99_listPrependToAll, item, list)

Prepends item to all items in list.

Examples

// +, 1, +, 2, +, 3
#define ML99_listPrependToAll(item, list)
Prepends item to all items in list.
Definition list.h:415

◆ ML99_listReplicate

#define ML99_listReplicate (   n,
  item 
)    ML99_call(ML99_listReplicate, n, item)

Computes a list of length n with each element item.

Examples

// ~, ~, ~, ~, ~
// ML99_nil()
#define ML99_listReplicate(n, item)
Computes a list of length n with each element item.
Definition list.h:683

◆ ML99_listReverse

#define ML99_listReverse (   list)    ML99_call(ML99_listReverse, list)

Reverses the order of items in list.

Examples

// 3, 2, 1
#define ML99_listReverse(list)
Reverses the order of items in list.
Definition list.h:319

◆ ML99_listTail

#define ML99_listTail (   list)    ML99_call(ML99_listTail, list)

Extracts the tail from the non-empty list list.

Examples

// 2, 3
// ML99_nil()
#define ML99_listTail(list)
Extracts the tail from the non-empty list list.
Definition list.h:100

◆ ML99_listTake

#define ML99_listTake (   n,
  list 
)    ML99_call(ML99_listTake, n, list)

Extracts the prefix of list of the length n.

If n is greater than the length of list, the whole list is returned.

Examples

// 1, 2
ML99_listTake(v(2), ML99_list(v(1, 2, 3)))
#define ML99_listTake(n, list)
Extracts the prefix of list of the length n.
Definition list.h:591

◆ ML99_listTakeWhile

#define ML99_listTakeWhile (   f,
  list 
)    ML99_call(ML99_listTakeWhile, f, list)

Extracts the items from list as long as f evaluates to ML99_true().

Examples

#include <metalang99/nat.h>
// 1, 2, 3
#define ML99_listTakeWhile(f, list)
Extracts the items from list as long as f evaluates to ML99_true().
Definition list.h:606

◆ ML99_listUnwrap

#define ML99_listUnwrap (   list)    ML99_call(ML99_listUnwrap, list)

Places all the items in list as-is.

Examples

// Literally 1 2 3
#define ML99_listUnwrap(list)
Places all the items in list as-is.
Definition list.h:287
Note
The resulting value is still a valid Metalang99 term that need to be evaluated further.
See also
ML99_LIST_EVAL
ML99_LIST_EVAL_COMMA_SEP

◆ ML99_listUnwrapCommaSep

#define ML99_listUnwrapCommaSep (   list)    ML99_call(ML99_listUnwrapCommaSep, list)

Places all the items in list as-is, separated by commas.

Examples

// Literally 1, 2, 3
#define ML99_listUnwrapCommaSep(list)
Places all the items in list as-is, separated by commas.
Definition list.h:305
Note
The resulting value is still a valid Metalang99 term that need to be evaluated further.
See also
ML99_LIST_EVAL
ML99_LIST_EVAL_COMMA_SEP

◆ ML99_listUnzip

#define ML99_listUnzip (   list)    ML99_call(ML99_listUnzip, list)

Transforms a list of two-place tuples into a tuple of a list of the first components and a list of the second components.

Examples

// ML99_tuple(ML99_list(v(1, 2, 3)), ML99_list(v(4, 5, 6)))
#define ML99_listUnzip(list)
Transforms a list of two-place tuples into a tuple of a list of the first components and a list of th...
Definition list.h:666
Tuples: (x, y, z).
#define ML99_tuple(...)
Transforms a sequence of arguments into (...).
Definition tuple.h:38

◆ ML99_listZip

#define ML99_listZip (   list,
  other 
)    ML99_call(ML99_listZip, list, other)

Computes a list of two-place tuples of the corresponding items from list and other.

Examples

// (1, 4), (2, 5), (3, 6)
ML99_listZip(ML99_list(v(1, 2, 3)), ML99_list(v(4, 5, 6)))
#define ML99_listZip(list, other)
Computes a list of two-place tuples of the corresponding items from list and other.
Definition list.h:650