What are the implementation strategies for multiple dispatch: class-based, or method-based organization, or either?

Regarding classes and methods, Practical Foundation of Programming Languages by Harper says:

Dynamic dispatch is often described in terms of a particular implementation strategy, which we will call the class-based organization. In this organization, each object is repre- sented by a vector of methods specialized to the class of that object. We may equivalently use a method-based organization in which each method branches on the class of an ob- ject to determine its behavior. Regardless of the organization used, the fundamental idea is that (a) objects are classified and (b) methods dispatch on the class of an object. The class-based and method-based organizations are interchangeable and, in fact, related by a natural duality between sum and product types. We explain this symmetry by focusing first on the behavior of each method on each object, which is given by a dispatch matrix. From this, we derive both a class-based and a method-based organization in such a way that their equivalence is obvious.

More generally, we may dispatch on the class of multiple arguments simultaneously. We concentrate on single dispatch for the sake of simplicity.

Does “we may dispatch on the class of multiple arguments simultaneously” mean “we may dispatch on the method of multiple arguments simultaneously”

For multiple dispatch, what is its implementation strategy? Class-based organization, or method-based organization, or either? (My guess is that class-based organization doesn’t work for multiple dispatch, but only for single dispatch.)


What are the pros and cons of multiclassing a Dragonborn Paladin with either Sorcerer or Warlock? and when and if to swap over [closed]

My Dragonborn Paladin is nearing the end of level 2, (Str3, Dex0, Con2, Int-1, Wis-1, Cha3, with Defensive giving AC19).

The main group I play with, he is the only Tank, unless my 10 year old daughter, joins in with her Circle of the moon Druid

She is the only child in the group and you can’t rely on her to focus on battle tactics 🙂

—————-new below ——————

My initial goal was to create a super paladin, I tend to play him as a tank with healing, saving my limited spell casting for just the right time due to limited spell slots, so I hardly ever use it. I once even died holding onto the valuable spell slots because I forgot about them.

However, once I started looking into it, I haven’t found that perfect sweet spot, that balances out the Spell Slinging Tank Front Man. All the options I’ve looked at have drawbacks that make me wonder if it is a combo that is worth pursuing

Just hoping for that splash of inspiration to make it all come together.

Should each and every link SER makes be sent to either GSA SEO Indexer or Indexing Service via API?

I am, as usual, trying to refine my efforts. Recently, I’ve been making some headway in this regard. :)
My big question I’ve been wanting to ask: Does every link SER makes require indexing?
I presently use GSA SEO Indexer, but not on EVERY project. Am I wasting efforts in not using either this program or an external indexer? Could I be getting more out of my linking with SER if I did index EVERY link?
Thanks, kindly, for any info…!

Is it bad UX for a form to be presented in different formats (either in a modal or separate page), depending on context?

I’m designing an internal tool in which a user, at certain points, will need to fill out a fairly detailed form in order to add a piece of content to our user-facing platform.

However, the challenge I’m facing is that the form is available at different points in the user’s journey, and I’m wondering if I can format the presentation of the form differently (either as a modal or a separate page) depending on where the user is and what they’re doing, to cater to separate use cases. Namely, I’d like to present it within a modal when the user is on a page where they’ll be engaged with a different, priority task, but needs to quickly fill out the form to create a piece of content, and then resume with the main task.

But elsewhere in the tool, I’d like to present the form on a separate page when the user is on the page where all those content pieces live – so that when the user clicks a “+New Content” CTA, they’ll be taken to a separate page where they’ll fill out the form.

Ultimately, I’m trying to cater to these separate use cases with these different interactions, but is the resulting inconsistency bad? Trying to understand the tradeoff here.

I hope this all makes sense, thanks for taking a look!

Context-free grammar how to have unequal number of a on either side of a b

I have been trying to create a CFG for the set

{w=(a^i)b(a^j)|where i =/= j} 

To my understanding, there are essentially 2 scenarios, one where there are more ‘a’s on the left side of ‘b’, and one where there are more ‘a’s on the right side of ‘b’. So far I have come up with:

S = TbR | RbT T = aT | ε R = TaT 

My intention is the have R to always have more ‘a’s than T, however I don’t think this is correct as T can be greater than R in this definition, as R could take be just ‘a’ while T is ‘aa’. I need a bit of help defining 2 variables T and R, where R always has more ‘a’s than T.

Cannot install anything? And cannot run ‘sudo apt-get update –fix-missing’ either?

I’ve installed ubuntu 19.04 in my laptop (Asus K501U): enter image description here

And there’s something not working properly. For some reason I cannot drag and drop files from or to my desktop (I need to cut whatever file or folder and manually paste it in the Desktop or out of it), and sometimes I cannot unselect any icon that I’ve selected. I need to press esc key several times and sometimes reboot the computer.

Now the latest issue is that I cannot install anything out of the software center.

I’ve downloaded XnRetro, and as you can see the XnRetro file that should be an executable does not have the proper icon. enter image description here

Anyway, if I click it nothing happens. And if I try to manually set a program to open it, nothing happens.

I’ve tried other options, and in all cases… it does nothing.

enter image description here

What’s going on? What can I do?

Please note that before posting it here, I’ve tried fixing anything that might be broken (even if it’s a fresh install). So, I’ve tried: After trying

sudo apt-get update –fix-missing 

reply: The update command takes no arguments

sudo dpkg –configure -a 

reply: dpkg: error: need an action option

sudo apt-get install -f 

reply: Reading package lists… Done Building dependency tree Reading state information… Done 0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.

If I click on “check for updates” button, I get this GNOME error: enter image description here

ip route add — Error: either “to” is duplicate, or “” is a garbage


The system boots without a default route. Then when I try to add a default route, there is this error.

The error occurs even when I completely clear the routing table.

The ip address is valid :

ip a ethusb: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:e0:4c:61:20:ca brd ff:ff:ff:ff:ff:ff inet brd scope global ethusb    valid_lft forever preferred_lft forever 

Here is the routing table at boot:

 ip r dev ethusb proto kernel scope link src 

And here is my attempt to add a default route

 ip r add default dev ethusb source  Error: either "to" is duplicate, or "" is a garbage 

What happens to bardic inspiration if either the bard or the recipient of the inspiration dies/goes unconscious?

In D&D 5e, a bard can give Bardic Inspiration – a d6-d12, depending on the level of the bard – which can be used by the recipient to add to a single ability check, attack roll, or saving throw within 10 minutes of getting the Bardic Inspiration die.

What happens to this Bardic Inspiration die when the bard goes unconscious/dies, or the character who received the inspiration goes unconscious?