pixel, (edited ) to swift
@pixel@social.pixels.pizza avatar

“This has come up several times on the forums, but I've never written it up in a standard place, so here it is: There are only three ways to get run-time polymorphism in Swift. Well, three and a half.”


https://belkadan.com/blog/2024/04/Run-time-Polymorphism-in-Swift/

snailman, to random
@snailman@ecoevo.social avatar

Cuban snail 🐌 project is GO! 🥂

CITES permit ✅
Nagoya ✅
Uni. Nottingham + Uni. de Oriente bilingual agreement ✅
Daily duolingo ✅ https://podcast.duolingo.com/spanish

Image shows red form of Polymita picta 📷 Dr Bernardo Reyes-Tur, collaborator
#UoN #CITES #Polymita #Genomics #colour #polymorphism #conservation

eLife, to evolution
@eLife@fediscience.org avatar

A genetic duplication event during #evolution allowed male wood tiger moths to switch up the patterns on their wings. #Genetics #Polymorphism https://elifesciences.org/articles/92763?utm_source=mastodon&utm_medium=social&utm_campaign=organic_insights

ctietze, to swift
@ctietze@mastodon.social avatar

What is the opposite of #polymorphism in terms of programming with (object) types and protocols/interfaces?

Given this maxim:

"Reserve Swift protocols for polymorphisms"

I do understand that the observation "protocol P is used conformed to by one class" is a violation of that maxim.

But what's a correct label for this observation?

"P is monomorphic"
or
"P's usage is monomorphic"
or
"P's usage is a monomorphism"

Or something else entirely?

#swift #swiftlang #fp #oop

some, to random

My CLI tool Depo, which aims to manage dependencies for #Clojure projects, which conveniently has many different formats of configurations, seems to be the perfect place to use #protocols
and #multimethods.

After rewriting the dispatch flow three times, I feel like this is the cleanest my abilities have been able to get it. Would be cool if someone would take a look-see and let me know if protocols/multimethods makes sense in this context!

#jvm #polymorphism #code #codereview

https://github.com/somecho/depo/blob/master/src/depo/dispatch.clj#L33

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • kavyap
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • GTA5RPClips
  • Youngstown
  • everett
  • slotface
  • rosin
  • osvaldo12
  • mdbf
  • ngwrru68w68
  • JUstTest
  • cubers
  • modclub
  • normalnudes
  • tester
  • khanakhh
  • Durango
  • ethstaker
  • tacticalgear
  • Leos
  • provamag3
  • anitta
  • cisconetworking
  • lostlight
  • All magazines