# Reliable way to distinguish a Guile file from a Scheme file

**URL:** <https://forum.systemcrafters.net/t/reliable-way-to-distinguish-a-guile-file-from-a-scheme-file/1232>\
**Category:** Scheme\
**Created:** [December 27, 2024, 5:43pm UTC](https://forum.systemcrafters.net/t/reliable-way-to-distinguish-a-guile-file-from-a-scheme-file/1232 "2024-12-27T17:43:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saccarosium](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@saccarosium](https://forum.systemcrafters.net/u/saccarosium)\
**Post date:** [December 27, 2024, 5:43pm UTC](https://forum.systemcrafters.net/t/reliable-way-to-distinguish-a-guile-file-from-a-scheme-file/1232/1 "2024-12-27T17:43:04Z")

</div>

I’ve been working on a [PR](https://github.com/vim/vim/pull/16198) in vim trying to upstream some of the great work done by this [plugin](https://gitlab.com/HiPhish/guile.vim).

I don’t know Guile really well. Is there something that can make it easier to check if the current `.scm` file is a guile file or a scheme file? I know that guile is a implementation of scheme but since we’ve decide to make a hole new filetype (witch is kind of a mode in emacs) I need some robust way to do that.

---

<div class="post-metadata">

**Author:** ![cow\_2001](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/cow_2001/32/598_2.png) [@cow\_2001](https://forum.systemcrafters.net/u/cow_2001)\
**Post date:** [December 27, 2024, 5:56pm UTC](https://forum.systemcrafters.net/t/reliable-way-to-distinguish-a-guile-file-from-a-scheme-file/1232/2 "2024-12-27T17:56:06Z")

</div>

I am not an expert, but it may be the case that (define-module …) is a unique Guile thing.

---

<div class="post-metadata">

**Author:** ![jvdydev](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/jvdydev/32/796_2.png) [@jvdydev](https://forum.systemcrafters.net/u/jvdydev)\
**Post date:** [December 27, 2024, 9:24pm UTC](https://forum.systemcrafters.net/t/reliable-way-to-distinguish-a-guile-file-from-a-scheme-file/1232/3 "2024-12-27T21:24:01Z")

</div>

Seems like no according to [this documentation](https://practical-scheme.net/wiliki/schemexref.cgi?define-module) and while Chez Scheme seems to not include it OOB, it seems like it may show up anyway as its implementation is in [the manual](https://www.scheme.com/csug8/syntax.html) ☹

(No idea if these sources are reasonable, haven’t done much in Scheme myself either)

---

<div class="post-metadata">

**Author:** ![noahevans](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@noahevans](https://forum.systemcrafters.net/u/noahevans)\
**Post date:** [December 28, 2024, 1:07am UTC](https://forum.systemcrafters.net/t/reliable-way-to-distinguish-a-guile-file-from-a-scheme-file/1232/4 "2024-12-28T01:07:54Z")

</div>

Maybe you could look at the heuristics geiser uses to determine the scheme

> **[Between the parens (Geiser User Manual)](https://www.nongnu.org/geiser/Between-the-parens.html#The-source-and-the-REPL)**
>
> Between the parens (Geiser User Manual)
