Last active
April 2, 2023 10:11
-
-
Save dacr/c1eee4f6735f456671f28fadbcbaefba to your computer and use it in GitHub Desktop.
implicit class scala feature. / published by https://github.com/dacr/code-examples-manager #7c2fd589-a63b-4d76-bdf6-90c812f99335/39bd0126b48109ba256b20762f7383e1853fe3db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// summary : implicit class scala feature. | |
// keywords : scala, language-feature, implicit-class, @testable | |
// publish : gist | |
// authors : David Crosson | |
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2) | |
// id : 7c2fd589-a63b-4d76-bdf6-90c812f99335 | |
// created-on : 2020-05-31T19:54:52Z | |
// managed-by : https://github.com/dacr/code-examples-manager | |
// run-with : scala-cli $file | |
// --------------------- | |
//> using scala "3.1.1" | |
// --------------------- | |
implicit class SuperRichString(in:String) { def truc = in.size/2} | |
println("hello".truc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment