slack1
2018-4-27 14:07:44

When I try to require both srfi 1 and srfi 26, I get an error message telling me that an identifier has already been imported from a different source


slack1
2018-4-27 14:08:01

How might i get around that conflict?


samth
2018-4-27 14:08:27

@slack1 I recommend using only-in or except-in


slack1
2018-4-27 14:08:48

Thanks


slack1
2018-4-27 14:09:23

I see, and require only the things you need to stop conflicts


greg
2018-4-27 14:13:54

There’s also prefix-in. Sometimes “the name shows where it came from” can be a readability advantage — for instance in code that’s “stitching together” things from various modules/systems/components. But for these specific srfis that’s likely to be more verbose than you want.


greg
2018-4-27 14:19:20

Like I’m guessing you don’t want to write (srfi26:cut cons (+ a 1) srfi26:<>) instead of (cut cons (+ a 1) <>) :smile:


slack1
2018-4-27 14:20:10

Oh I see, but for a utilities library that could work great


greg
2018-4-27 14:20:20

But in say a web app, requiring modules using some prefixes like db:, auth:, email: or whatever might make some of the code read more clearly.


slack1
2018-4-27 14:20:41

basically arbitrarily nameable imports


greg
2018-4-27 14:21:08

Yeah there’s even a require form where you supply a function that can munge the names totally arbitrarily. ¯_(ツ)_/¯


greg
2018-4-27 14:22:49

e.g. (require (filtered-in LOLcat-ize-the-names srfi1))


slack1
2018-4-27 14:26:17

that’s actually amazing lol


slack1
2018-4-27 14:26:22

although I probably won’t use that power anytime soon


greg
2018-4-27 14:27:15

Oh. Ha. I didn’t even realize that LOLcat might be relevant to your interests :grin: