You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Magicasting is the process of generating adapter code when passing an argument whose runtime type is unknown is incompatible with the statically expected type.
This is how for example a Clojure vector is dynamically typed AND can still be passed to any Dart method expecting a List<Foo>.
Adapter code is expected to run in constant time -- if something can't be adapted cheaply it shouldn't be implicitely adapted.
This issue is there to collect thoughts about allowing user to extend magicasting (a bit like one can extend core protocols). Similar precautions to protocol extension should be taken: avoid creating an extension when you don't own one of the type/protocols involved.
An extension that cljd.core could provide could be allowing function to be magicasted to Sink for example.
Generally is more magicasting a good idea (or too magic like the example above) ?
If it's a good idea, should we open it or is it a Pandora's box?
The text was updated successfully, but these errors were encountered:
Magicasting is the process of generating adapter code when passing an argument whose runtime type is unknown is incompatible with the statically expected type.
This is how for example a Clojure vector is dynamically typed AND can still be passed to any Dart method expecting a
List<Foo>
.Adapter code is expected to run in constant time -- if something can't be adapted cheaply it shouldn't be implicitely adapted.
This issue is there to collect thoughts about allowing user to extend magicasting (a bit like one can extend core protocols). Similar precautions to protocol extension should be taken: avoid creating an extension when you don't own one of the type/protocols involved.
An extension that cljd.core could provide could be allowing function to be magicasted to Sink for example.
Generally is more magicasting a good idea (or too magic like the example above) ?
If it's a good idea, should we open it or is it a Pandora's box?
The text was updated successfully, but these errors were encountered: