]> gitweb.factorcode.org Git - factor.git/commit
constructors: Unify C:, CONSTRUCTOR:, NAMED-CONSTRUCTOR:, and DEFAULT-CONSTRUCTOR...
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 4 Nov 2014 23:56:23 +0000 (15:56 -0800)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 4 Nov 2014 23:56:23 +0000 (15:56 -0800)
commit73bd47f639da767e74a2a849a6482f3a331980f3
tree2ab90616e4212d1107c56522fbcb0ae63eca31e3
parentdb88ae8d30a1142b32fd9c02d58405dbf06aec0d
constructors: Unify C:, CONSTRUCTOR:, NAMED-CONSTRUCTOR:, and DEFAULT-CONSTRUCTOR: by requiring the class name after the constructor word name.

example: CONSTRUCTOR: <foo> foo ( stack effect -- obj ) ;

The benefit is that we can now search for <foo> by name and it's not auto-generated--less magic. Also, there are fewer kinds of constructors.

Rename CONSTRUCTOR-SYNTAX: to SLOT-CONSTRUCTOR: since it's more descriptive.
extra/constructors/constructors-tests.factor
extra/constructors/constructors.factor