Is it possible to use shorthand for blocks in Crystal, for example.
my_array.sort_by(&:size)
This attempt returns an error:
... expected function type, not character
You can use this syntax:
my_array = ["123", "22", "1"] sorted = my_array.sort_by &.size puts sorted => ["1", "22", "123"]
Source: https://habr.com/ru/post/1629881/More articles:How to achieve shadow effect using GradientPaint in Java swing? - javaImage with shadow and rounded edges in java swing - java_psycopg psycopg2 not found - pythonFailed to install socket with any host provided - androiddefinition of swagger splitting in many files - restWebrtc remote video stream not working - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1629883/how-to-do-correct-repository-factory&usg=ALkJrhizO6uo9c9FYHI-8KpRQn5DaUyUFwBinaryRead request in ASP.NET 5 (MVC6) - c #Невозможно создать новый проект в Visual Studio 2015 - visual-studioConverting a data format from one object to an array of objects of a pair of key values - jsonAll Articles