[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: get-default-value (was Re: #f = #none ?)



Sorry about contributing to this thread a week late, but:

Christopher Fry (cfry@MIT.EDU) writes:

  If our problem is getting to explcitly use a default value, how
  about a function that, given the name of a function and the name of
  one of its arguments, returns the value of the default for that
  function. SO:

  (defun foo (a &optional (b (+ 2 3)) ...)
  (foo 1 (get-default-value 'foo 'b))

  One problem is that if we've got

  (defun foo (a &optional (b (+ a 3)) ...)

  then it doesn't work so well without special hacks.
  I guess dylan doesn't have this particular problem but ...

Yes it does, since keyword defaults are arbitrary forms:

  (method (a #key (b (+ a 3)) (c (make-default-whatever))))

John Burger
john@mitre.org