cloudhead/less.js — pull request #619 by donaldharvey (2012-02-04 23:49:24+00:00)
Title: Implemented named arguments

I've reimplemented named arguments using the same syntax as [James' earlier implementation](https://github.com/cloudhead/less.js/pull/268) - i.e. `.mixin(@arg: value, @arg2: value)`. I'm not yet convinced that this is the best syntax: it's certainly consistent with mixin definitions, but it feels a little bit strange if you're passing variables in with the same name as the keyword argument (e.g. `.mixin(@width: @width)`). Feedback and/or suggestions on an alternative syntax from LESS users would be appreciated!

The implementation places constraints on keyword arguments similar to those of Python: errors are thrown when positional arguments are placed after keyword arguments, when multiple values are received for a parameter, and when unexpected keyword arguments are received.

I'm not really sure how well named arguments work with combined with some of the recent additions to mixins (mainly patterns and `@arguments`); the current behaviour works, but might be unintuitive. Again, feedback from users would be helpful!