Názory k článku Makro procesor GNU m4 (5)

  • Článek je starý, nové názory již nelze přidávat.
  • 7. 9. 2009 16:15

    Pety (neregistrovaný)

    Opet jsem zjistil, ze chybi vsechny informace o parametrech v makrech.
    Zkusim kontaktovat autora clanku, at to hromadne opravi ve vsech dilech tohohle serialu. :)
    V tomhle dile by to melo byt nejak takhle:
    < define(`obratit', `ifelse($#, 0, ,
    < $#, 1, ``'',
    < `obratit(shift($@)), `'')')

    > define(`obratit', `ifelse($#, 0, ,
    > $#, 1, ``$1'',
    > `obratit(shift($@)), `$1'')')

    < define(`$switch',
    < `ifelse($#, 1, ,
    < $#, 2, ``'',
    < `', `', ``'',
    < `indir(`$switch', `', shift(shift(shift($@))))')')

    > define(`$switch',
    > `ifelse($#, 1, ,
    > $#, 2, ``$2'',
    > `$1', `$2', ``$3'',
    > `indir(`$switch', `$1', shift(shift(shift($@))))')')

    < define(`cyklus_for',
    < `pushdef(`', `')indir(`$for', `', `', `', `')popdef(`')')
    < define(`$for', ``'ifelse(, `', ,
    < `define(`', incr())indir(`$for', `', `', `', `')')')

    > define(`cyklus_for',
    > `pushdef(`$1', `$2')indir(`$for', `$1', `$2', `$3', `$4')popdef(`$1')')
    > define(`$for', `$4`'ifelse($1, `$3', ,
    > `define(`$1', incr($1))indir(`$for', `$1', `$2', `$3', `$4')')')

    Cus,
    Pety aka Poke.