{ "@context":[ "https://www.w3.org/ns/activitystreams", {"Hashtag":"as:Hashtag"} ], "published":"2023-02-13T18:42:30.379Z", "attributedTo":"https://epiktistes.com/actors/toddsundsted", "to":["https://www.w3.org/ns/activitystreams#Public"], "cc":["https://epiktistes.com/actors/toddsundsted/followers"], "content":"

til... the following works in #crystallang

[{1}, {2}, {3}].sort_by(&.first.-) # => [{3}, {2}, {1}]

because - is a method that returns the negative value of the number on which it is called. (the tuple in the example is obviously contrived...) this is in contrast to the following, which do the same thing but are more verbose:

puts [{1}, {2}, {3}].sort_by { |t| -t.first } \r\nputs [{1}, {2}, {3}].sort_by(&.first).reverse
", "mediaType":"text/html", "attachment":[], "tag":[ {"type":"Hashtag","name":"#crystallang","href":"https://epiktistes.com/tags/crystallang"} ], "type":"Note", "id":"https://epiktistes.com/objects/qCH4VQQg1xs" }