Cut the eggplants in half lengthwise and score the flesh deeply in a crosshatch pattern.
Sprinkle with salt and let them sit for about 30 minutes.
Cook the lentils according to package instructions until al dente, about 20 minutes.
Heat the oil in a pan. Sauté the onions, carrots, and garlic until softened.
Deglaze with about 70 ml of water and let it simmer until the water has evaporated.
Preheat the oven to 180°C (350°F).
Drain the cooked lentils and fold them into the pan mixture.
Season with salt, pepper, Ras el Hanout, coriander seeds, allspice, and cumin. Adjust seasoning to taste. Keep warm.
Pat the eggplants dry with a paper towel and brush them with a little olive oil. Season with salt and pepper.
Bake in the preheated oven for about 40 minutes, or until tender.