Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why can it deduce from (READ-FROM-STRING “foobar” :START 3) that the intent is to specify the START keyword parameter rather than the EOF-ERROR-P and EOF-VALUE optional parameters?

0
0 Posted

Why can it deduce from (READ-FROM-STRING “foobar” :START 3) that the intent is to specify the START keyword parameter rather than the EOF-ERROR-P and EOF-VALUE optional parameters?

0
0

In Common Lisp, keyword symbols are first-class data objects. Therefore, they are perfectly valid values for optional parameters to functions. There are only four functions in Common Lisp that have both optional and keyword parameters (they are PARSE-NAMESTRING, READ-FROM-STRING, WRITE-LINE, and WRITE-STRING), so it’s probably not worth adding a nonorthogonal kludge to the language just to make these functions slightly less confusing; unfortunately, it’s also not worth an incompatible change to the language to redefine those functions to use only keyword arguments.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123