Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bb's clojure.core/read requires LineNumberingPushbackReader #1086

Closed
Cnly opened this issue Dec 4, 2021 · 2 comments
Closed

bb's clojure.core/read requires LineNumberingPushbackReader #1086

Cnly opened this issue Dec 4, 2021 · 2 comments

Comments

@Cnly
Copy link
Contributor

Cnly commented Dec 4, 2021

version

v0.6.8

platform

macOS

problem

clojure.core/read's doc says the stream must be an instance of java.io.PushbackReader or some derivee. While this is true in clojure, in babashka if that reader is used, I get the error

Type:     java.lang.IllegalArgumentException
Message:  No implementation of method: :get-line-number of protocol: #'clojure.tools.reader.reader-types/IndexingReader found for class: java.io.PushbackReader

Using clojure.lang.LineNumberingPushbackReader instead fixes this.

repro

The following script runs in clojure but not in bb:

(ns hello
  (:require [clojure.java.io :as io])
  (:import [java.io PushbackReader]))

(println (let [reader (PushbackReader. (io/reader *file*))]
   (read reader)))

expected behavior

bb shouldn't require LineNumberingPushbackReader.

@borkdude
Copy link
Collaborator

borkdude commented Dec 4, 2021

@Cnly bb master should now support this (just pushed). Will write a test tomorrow, so I'll leave this open still.

borkdude added a commit to babashka/sci that referenced this issue Dec 5, 2021
@borkdude
Copy link
Collaborator

borkdude commented Dec 5, 2021

Fixed.

@borkdude borkdude closed this as completed Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants