guenchi / Liber

Liber is a template parser for Scheme List to HTML
MIT License
11 stars 1 forks source link

Trying to install liber via raven, definition conflict and import problems. #1

Open nomelif opened 5 years ago

nomelif commented 5 years ago

Hello. I am very much new to the world of Schemes. I apologize in advance if I am missing something obvious. I tried to install liber via raven as follows:

[shadoko@poppisrausku ~]$ mkdir libertest
[shadoko@poppisrausku ~]$ cd libertest/
[shadoko@poppisrausku libertest]$ raven install liber
loading liber 0.1.0 ......
######################################################################### 100,0%
load liber 0.1.0 success
raven install over

Trying to import it fails:

[shadoko@poppisrausku libertest]$ scheme
Chez Scheme Version 9.5.3
Copyright 1984-2019 Cisco Systems, Inc.

> (library-directories "lib")
> (import (liber liber))
Exception: library (liber liber) not found
Type (debug) to enter the debugger.
> 

I tried to rename the source files from .sc to .scm as I had seen that extension before. This caused chez to recognize the library but throw another error:

[shadoko@poppisrausku libertest]$ cd lib/liber/
[shadoko@poppisrausku liber]$ ls
liber.sc  LICENSE  package.sc  README.md
[shadoko@poppisrausku liber]$ mv liber.sc liber.scm
[shadoko@poppisrausku liber]$ mv package.sc package.scm
[shadoko@poppisrausku liber]$ cd ../../
[shadoko@poppisrausku libertest]$ scheme
Chez Scheme Version 9.5.3
Copyright 1984-2019 Cisco Systems, Inc.

> (library-directories "lib")
> (import (liber liber))
Exception: multiple definitions for div and meta in body (library (liber liber) (export !-- bcstr cstr HTML HEAD ...) (import (scheme)) (define !-- list) (define bcstr (lambda (...) (...))) ...) at line 1, char 1 of lib/liber/liber.scm
Type (debug) to enter the debugger.
> 

This looks a lot like an internal error, but perhaps my unguided brain surgery caused it. My point here is that my paths are correct as renaming the file shows.

I assume that changing extensions isn't the right way to go. How should I get chez to detect the library?

Here is some info about my device:

[shadoko@poppisrausku libertest]$ raven -v
Raven version: 0.3.6
[shadoko@poppisrausku libertest]$ uname -a
Linux poppisrausku 5.0.10-arch1-1-ARCH #1 SMP PREEMPT Sat Apr 27 20:06:45 UTC 2019 x86_64 GNU/Linux

Thanks in advance for your help.

guenchi commented 5 years ago

export CHEZSCHEMELIBDIRS=.:lib:/usr/local/lib && export CHEZSCHEMELIBEXTS=.chezscheme.sls::.chezscheme.so:.ss::.so:.sls::.so:.scm::.so:.sch::.so:.sc::.so

or

(library-directories `(("./lib" . "./lib"))) (library-extensions (cons (cons ".sc" ".so") (library-extensions)))

nomelif commented 5 years ago

Thanks, this solves the extension question. I still get this error:


[shadoko@poppisrausku libertest]$ scheme
Chez Scheme Version 9.5.3
Copyright 1984-2019 Cisco Systems, Inc.

> (library-directories `(("./lib" . "./lib")))
> (library-extensions (cons (cons ".sc" ".so") (library-extensions)))
> (import (liber liber))
Exception: multiple definitions for div and meta in body (library (liber liber) (export !-- bcstr cstr HTML HEAD ...) (import (scheme)) (define !-- list) (define bcstr (lambda (...) (...))) ...) at line 1, char 1 of ./lib/liber/liber.sc
Type (debug) to enter the debugger.
> 

Am I still doing something wrong?

guenchi commented 5 years ago

the first problem because you don't run it with " raven run", witch auto-modify the library's path.

for the second one

run with "scheme --script"

or

if you want run with --program

try delete: (import (scheme)) in 71 and 72 lines of source liber.sc