sortable

create a sort descriptor method automatically using given type field


Parameters

sortable field :literal

Returns

  • :method

Examples

copy
define :cat [ init: constructor [name :string age :integer] compare: sortable 'age ] snowflake: to :cat ["Snowflake" 3] smith: to :cat ["Smith" 6] compare snowflake smith ; => -1 snowflake < smith ; => true

Related