Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 771 Bytes

README.md

File metadata and controls

40 lines (29 loc) · 771 Bytes

Anaphora

build-and-test

Anaphoric constructs for Dylan

aif

Sometimes, in a program, we want to test if an expression returns a value or is #f, and if so, to do something with the value. If the expression is costly to evaluate, then we must do something like this:

let result = big-long-calculation();
if (result)
  foo(result)
end;

But with aif we could say:

aif(big-long-calculation())
  foo(it)
end;

or

aif(big-long-calculation())
  foo(it)
else
  bar()
end;

References

On Lisp (ch 14), by Paul Graham, for original Lisp implementation