Giter Site home page Giter Site logo

Cannot import `(scheme srfi-170)` about ol HOT 10 CLOSED

bentxt avatar bentxt commented on August 29, 2024
Cannot import `(scheme srfi-170)`

from ol.

Comments (10)

lassik avatar lassik commented on August 29, 2024 1

It's kind of obscure, but R7RS section 5.6.1 Library Syntax says:

Libraries whose first identifier is scheme are reserved for use by this report and future versions of this report. Libraries whose first identifier is srfi are reserved for libraries implementing Scheme Requests for Implementation.

This is the (srfi 1) form that all R7RS implementations now use. (Guile was the last holdout, but (import (srfi 1)) now works in Guile 3.0.9.)

from ol.

yuriy-chumak avatar yuriy-chumak commented on August 29, 2024

That's strange...

~/Workspace/ol.git$ sudo make uninstall
rm -rf /usr/bin/ol
rm -rf /usr/bin/olvm
rm -rf /usr/lib/libol.so
rm -rf /usr/lib/ol/repl
rm -rf /usr/lib/ol
rm -rf /usr/include/ol
rm -rf /usr/share/man/man1/ol.1.gz

~/Workspace/ol.git$ sudo make install
# install Ol executable(s) to /usr/bin:
Installing main binary...
install -d /usr/bin
install ol /usr/bin/ol
Installing ol virtual machine binary...
install -d /usr/bin
install vm /usr/bin/olvm
Installing libol.so...
install libol.so /usr/lib/libol.so
Installing headers...
install -d /usr/include/ol
install -m 644 includes/ol/vm.h /usr/include/ol/vm.h
install -m 644 includes/ol/ol.h /usr/include/ol/ol.h
# and libraries to /usr/lib/ol:
Installing basic libraries...
cd libraries && find * -type d -exec install -d "{}" "/usr/lib/ol/{}" \;
cd libraries && find * -type f -exec install -m 644 "{}" "/usr/lib/ol/{}" \;
# install Ol binary REPL to /usr/lib/ol:
Installing REPL...
install -d /usr/lib/ol
install -m 644 repl /usr/lib/ol/repl
Installing man page...
install -d /usr/share/man/man1
gzip <ol.1 >/usr/share/man/man1/ol.1.gz
Ok.

~/Workspace/ol.git$ ./ol
Welcome to Otus Lisp 2.3.9-3574-5707caf6
type ',help' to help, ',quit' to end session.
> (import (scheme srfi-170))
> ;; Library (scheme srfi-170) added
> ;; Imported (scheme srfi-170)
> 

I'll recheck with fresh new VM.

from ol.

yuriy-chumak avatar yuriy-chumak commented on August 29, 2024

It works under fresh new VM without any changes.

@bentxt, try to make uninstall; make install.
OR
./ol --home=`pwd`/libraries in the Ol repository to test.

from ol.

lassik avatar lassik commented on August 29, 2024

In Scheme we generally use (import (srfi 170)). RnRS reserves the (import (scheme <...>)) library namespace for itself. What's the rationale for diverging from this convention?

from ol.

yuriy-chumak avatar yuriy-chumak commented on August 29, 2024

What's the rationale

Historical reasons.
I haven't seen any srfi location standard, but you'r right I think... Hmmmm.

from ol.

yuriy-chumak avatar yuriy-chumak commented on August 29, 2024
  • guile: (srfi srfi-1)
  • chez: no srfi (?)
  • chibi: (srfi 1)
  • chicken: srfi-1
  • gambit: (srfi 1)
  • gauche: (srfi 1)
  • kawa: (srfi :101)
  • mit: (runtime srfi-1)
  • racket: srfi/1
  • stklos: (srfi 1)

Which one is better? ))

from ol.

lassik avatar lassik commented on August 29, 2024
  • In a recent MIT Scheme, try ,(import (srfi 1)) with the comma. It should work.
  • In Chicken, try chicken-install r7rs && csi -R r7rs and (import (srfi 1)).
  • Chez (and many other R6RS implementations) can use chez-srfi. The syntax then is (import (srfi :1)). The is : a hack due to a limitation in the R6RS standard that library name parts cannot be numbers.

from ol.

yuriy-chumak avatar yuriy-chumak commented on August 29, 2024

Libraries whose first identifier is srfi are reserved for libraries implementing Scheme Requests for Implementation.

Ah, I see!

Thank you. I'll update provided Ol's srfi implementations according to R7RS.

from ol.

lassik avatar lassik commented on August 29, 2024

Excellent. Thank you very much!

from ol.

yuriy-chumak avatar yuriy-chumak commented on August 29, 2024

(import (scheme srfi-170)) works fine.
(import (srfi 170)) works fine.

Closing.
Feel free to open new one if needed.
image

from ol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.