[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: define-language

From: Matt Wette
Subject: Re: define-language
Date: Fri, 7 Aug 2020 15:34:30 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]