kiss-lang / kiss

A type-safe, compiled Lisp for Haxe programs
GNU Lesser General Public License v2.1
3 stars 0 forks source link

specialForm implementation of &rest arguments is bad and breaks (apply) #10

Closed NQNStudios closed 9 months ago

NQNStudios commented 9 months ago

Replace it with a Reflect.makeVarArgs implementation

However, seems like that could break a lot of code?

NQNStudios commented 9 months ago

One thing that would be lost is the compiler's ability to make sure all the args are there. Maybe making a specialForm on top of a makeVarArgs function would be good.

NQNStudios commented 9 months ago

Why did I make it a special form and not a macro in the first place? Every &rest args specialForm would need to implement a specialFormMacroExpander to work with the fix for #7

NQNStudios commented 9 months ago

Actually they wouldn't, because all arguments to a &rest function get macroExpanded.

NQNStudios commented 9 months ago

They must be special forms because a macro returning (macro <...>) would evaluate itself forever.

NQNStudios commented 9 months ago

I'm gonna triage this issue because it doesn't have practical use. It could only invite bugs.