The SO you quote includes an operator. So that's not the problem.

The SO is written by jnthn. It doesn't get more authoritative than that.

"Cannot import symbol '%?LANG' from 'Graphics::Shapes', because it
already exists in this lexical scope."

Your export code is attempting to export `%?LANG`, but that already
exists in every lexical scope. (`%?LANG`:is the language braid -- the
dictionary of sub-languages that collectively constitute the Raku language.)

So don't do that.

In the SO jnthn demonstrates stripping out `$_`. You need to also strip
out any other lexicals that you don't mean to export. So use a `say` to
see what lexicals you're currently exporting and then grep out any that
you don't mean to export.

Perhaps share your code if you can't get it to work.

--
love, raiph

On Fri, Aug 14, 2020 at 9:32 AM Stuart Hungerford
<stuart.hungerf...@gmail.com> wrote:
>
> Hi,
>
> I'm using the technique described in this thread
> https://stackoverflow.com/questions/61179586/use-haskell-like-prelude-modules-in-a-module-in-raku
> to re-export module sub-trees in a project. One of these re-export
> modules also exports an infix operator. The others only export classes
> and roles.
>
> The operator-exporting module gives an error:
>
> Cannot import symbol '%?LANG' from 'Graphics::Shapes', because it
> already exists in this lexical scope.
>
> Can I modify the original technique to also cope with exported
> operators?  Is this still the best way to approach this issue?
>
> Thanks,
>
> Stu

Reply via email to