unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Matt Wette <matt.wette@gmail.com>
To: guile-user@gnu.org
Subject: Re: define-language
Date: Fri, 7 Aug 2020 15:34:30 -0700	[thread overview]
Message-ID: <8a6f0667-38ad-ba3c-f344-2f8b73113ff1@gmail.com> (raw)
In-Reply-To: <CAKjnHz3smqqOWCXPPpaVjWVymr-U482q6phXCDEZpxDLjkEtBA@mail.gmail.com>



On 8/7/20 12:31 PM, Stephen Scheck wrote:
> What is the right way to use `define-language`? The Guile manual says that
> when using this form "the language will be added to the global language
> set." I interpret that to mean that the `,language` meta-command switches
> the REPL to use the newly-defined language, but it doesn't work:
>
> scheme@(guile-user)> (use-modules (system base language))
> scheme@(guile-user)> (define-language mylingua
>    #:title "Mylingua"
>    #:reader (lambda (port env) ...)
>    #:evaluator (lambda (x module) ...)
>    #:printer write)
> scheme@(guile-user)> mylingua
> $1 = #<<language> name: mylingua title: "Mylingua" reader: #<procedure
> 1bfcd38 at <unknown port>:5:11 (port env)> printer: #<procedure write (_
> #:optional _)> parser: #f compilers: () decompilers: () evaluator:
> #<procedure 1bfcd48 at <unknown port>:6:14 (x module)> joiner: #f
> for-humans?: #t make-default-environment: #<procedure
> make-fresh-user-module ()> lowerer: #f analyzer: #f compiler-chooser: #f>
> scheme@(guile-user)> ,language mylingua
> While executing meta-command:
> no such language mylingua

Also, I believe you need to have the language defined in a
module (i.e., define-module) with path (language mylingua spec)
in file spec.scm in a subdirectory language/mylingua.



      parent reply	other threads:[~2020-08-07 22:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 19:31 define-language Stephen Scheck
2020-08-07 21:46 ` define-language Matt Wette
2020-08-07 22:34 ` Matt Wette [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8a6f0667-38ad-ba3c-f344-2f8b73113ff1@gmail.com \
    --to=matt.wette@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).