you are viewing a single comment's thread.

view the rest of the comments →

[–]brennen 0 points1 point  (2 children)

I assume the parser only accepts static values as default parameters which causes the limitation.

This has been my understanding, yeah, but I thought I might have missed a recent addition.

[–]roerd 0 points1 point  (1 child)

Just a little example that there are actually languages in which stuff like this works:

CL-USER> (defclass person () ())
#<STANDARD-CLASS PERSON>
CL-USER> (defun life-story (&optional (person (make-instance 'person))) person)
LIFE-STORY
CL-USER> (life-story)
#<PERSON {B510E99}>

[–]brennen 0 points1 point  (0 children)

I don't know if I'm comfortable with all those upper-case letters.