009.define   [plain text]

dnl @ ../doc/m4.texinfo:1213: Origin of test
dnl @ Copyright (C) 2006 Free Software Foundation
dnl @ This file is free software; the Free Software Foundation
dnl @ gives unlimited permission to copy and/or distribute it
dnl @ with or without modifications, as long as this notice
dnl @ is preserved.
define(`array', `defn(format(``array[%d]'', `$1'))')
dnl @result{}
define(`array_set', `define(format(``array[%d]'', `$1'), `$2')')
dnl @result{}
array_set(`4', `array element no. 4')
dnl @result{}
array_set(`17', `array element no. 17')
dnl @result{}
dnl @result{}array element no. 4
array(eval(`10 + 7'))
dnl @result{}array element no. 17