Generic swap: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
Do your best! |
Do your best! |
||
=={{header|ACL2}}== |
|||
<lang Lisp>(defun swap (pair) |
|||
(cons (cdr pair) |
|||
(car pair))) |
|||
(let ((p (cons 1 2))) |
|||
(cw "Before: ~x0~%After: ~x1~%" p (swap p)))</lang> |
|||
=={{header|Ada}}== |
=={{header|Ada}}== |