GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing clojure.github.io — clojure.tools.reader - tools.reader 1.3.7-SNAPSHOT API documentation API for clojure.tools.reader - tools.reader 1.3.7-SNAPSHOT (in development)by BronsaFull namespace name: clojure.tools.reader OverviewProject home page is https://github.com/clojure/tools.reader/
A clojure reader in clojure Public Variables and Functions*alias-map*dynamic varMap from ns alias to ns, if non-nil, it will be used to resolve read-time ns aliases instead of (ns-aliases *ns*). Defaults to nilSource *data-readers*dynamic varMap from reader tag symbols to data reader Vars. Reader tags without namespace qualifiers are reserved for Clojure. Default reader tags are defined in clojure.tools.reader/default-data-readers and may be overridden by binding this Var.Source *default-data-reader-fn*dynamic varWhen no data reader is found for a tag and *default-data-reader-fn* is non-nil, it will be called with two arguments, the tag and the value. If *default-data-reader-fn* is nil (the default value), an exception will be thrown for the unknown tag.Source *read-eval*dynamic varDefaults to true. ***WARNING*** This setting implies that the full power of the reader is in play, including syntax that can cause code to execute. It should never be used with untrusted sources. See also: clojure.tools.reader.edn/read. When set to logical false in the thread-local binding, the eval reader (#=) and *record/type literal syntax* are disabled in read/load. Example (will fail): (binding [*read-eval* false] (read-string "#=(* 2 21)")) When set to :unknown all reads will fail in contexts where *read-eval* has not been explicitly bound to either true or false. This setting can be a useful diagnostic tool to ensure that all of your reads occur in considered contexts.Source default-data-readersvarDefault map of data reader functions provided by Clojure. May be overridden by binding *data-readers*Source map-funcfunctionUsage: (map-func coll) Decide which map type to use, array-map if less than 16 elementsSource readfunctionUsage: (read)
(read reader)
(read opts reader)
(read reader eof-error? eof-value)
Reads the first object from an IPushbackReader or a java.io.PushbackReader.
Returns the object read. If EOF, throws if eof-error? is true.
Otherwise returns sentinel. If no stream is provided, *in* will be used.
Opts is a persistent map with valid keys:
:read-cond - :allow to process reader conditionals, or
:preserve to keep all branches
:features - persistent set of feature keywords for reader conditionals
:eof - on eof, return value unless :eofthrow, then throw.
if not specified, will throw
***WARNING***
Note that read can execute code (controlled by *read-eval*),
and as such should be used only with trusted sources.
To read data structures only, use clojure.tools.reader.edn/read
Note that the function signature of clojure.tools.reader/read and
clojure.tools.reader.edn/read is not the same for eof-handling
Source
read+stringfunctionUsage: (read+string)
(read+string stream)
(read+string stream eof-error? eof-value)
(read+string opts stream)
Like read, and taking the same args. reader must be a SourceLoggingPushbackReader. Returns a vector containing the object read and the (whitespace-trimmed) string read.Source read-stringfunctionUsage: (read-string s)
(read-string opts s)
Reads one object from the string s. Returns nil when s is nil or empty. ***WARNING*** Note that read-string can execute code (controlled by *read-eval*), and as such should be used only with trusted sources. To read data structures only, use clojure.tools.reader.edn/read-string Note that the function signature of clojure.tools.reader/read-string and clojure.tools.reader.edn/read-string is not the same for eof-handlingSource resolve-symboldynamic functionUsage: (resolve-symbol s) Resolve a symbol s into its fully qualified namespace versionSource syntax-quotemacroUsage: (syntax-quote form) Macro equivalent to the syntax-quote reader macro (`).Source clojure.tools.reader.ednAn EDN reader in clojure Public Variables and FunctionsreadfunctionUsage: (read)
(read reader)
(read {:keys [eof], :as opts} reader)
(read reader eof-error? eof opts)
Reads the first object from an IPushbackReader or a java.io.PushbackReader. Returns the object read. If EOF, throws if eof-error? is true otherwise returns eof. If no reader is provided, *in* will be used. Reads data in the edn format (subset of Clojure data): http://edn-format.org clojure.tools.reader.edn/read doesn't depend on dynamic Vars, all configuration is done by passing an opt map. opts is a map that can include the following keys: :eof - value to return on end-of-file. When not supplied, eof throws an exception. :readers - a map of tag symbols to data-reader functions to be considered before default-data-readers. When not supplied, only the default-data-readers will be used. :default - A function of two args, that will, if present and no reader is found for a tag, be called with the tag and the value.Source read-stringfunctionUsage: (read-string s)
(read-string opts s)
Reads one object from the string s. Returns nil when s is nil or empty. Reads data in the edn format (subset of Clojure data): http://edn-format.org opts is a map as per clojure.tools.reader.edn/readSource clojure.tools.reader.impl.commonsPublic Variables and Functionsnumber-literal?functionUsage: (number-literal? reader initch) Checks whether the reader is at the start of a number literalSource parse-symbolfunctionUsage: (parse-symbol token) Parses a string into a vector of the namespace and symbolSource read-pastfunctionUsage: (read-past pred rdr) Read until first character that doesn't match pred, returning char.Source skip-linefunctionUsage: (skip-line reader) Advances the reader to the end of a line. Returns the readerSource clojure.tools.reader.impl.errorsPublic Variables and Functionseof-errorfunctionUsage: (eof-error rdr & msgs) Throws an ExceptionInfo with the given message. If rdr is an IndexingReader, additional information about column and line number is providedSource illegal-arg-errorfunctionUsage: (illegal-arg-error rdr & msgs) Throws an ExceptionInfo with the given message. If rdr is an IndexingReader, additional information about column and line number is providedSource reader-errorfunctionUsage: (reader-error rdr & msgs) Throws an ExceptionInfo with the given message. If rdr is an IndexingReader, additional information about column and line number is providedSource clojure.tools.reader.impl.inspectPublic Variables and FunctionsinspectfunctionUsage: (inspect x)
(inspect truncate x)
Return a string description of the value supplied. May be the a string version of the value itself (e.g. "true") or it may be a description (e.g. "an instance of Foo"). If truncate is true then return a very terse version of the inspection.Source clojure.tools.reader.reader-typesProtocols and default Reader types implementation ProtocolsIPushbackReaderProtocolKnown implementations: IndexingPushbackReader, java.io.PushbackReader, PushbackReader, SourceLoggingPushbackReader unreadfunctionUsage: (unread reader ch) Pushes back a single character on to the stream IndexingReaderProtocolKnown implementations: clojure.lang.LineNumberingPushbackReader, IndexingPushbackReader, SourceLoggingPushbackReader get-column-numberfunctionUsage: (get-column-number reader) Returns the column number of the next character to be read from the stream get-file-namefunctionUsage: (get-file-name reader) Returns the file name the reader is reading from, or nil get-line-numberfunctionUsage: (get-line-number reader) Returns the line number of the next character to be read from the stream ReaderProtocolKnown implementations: IndexingPushbackReader, InputStreamReader, java.io.PushbackReader, PushbackReader, SourceLoggingPushbackReader, StringReader peek-charfunctionUsage: (peek-char reader) Returns the next char from the Reader without removing it from the reader stream read-charfunctionUsage: (read-char reader) Returns the next char from the Reader, nil if the end of stream has been reached TypesIndexingPushbackReadertypeFields: [rdr line column line-start? prev prev-column file-name normalize?] Protocols: IPushbackReader, IndexingReader, Reader Interfaces: java.io.Closeable PushbackReadertypeFields: [rdr buf buf-len buf-pos] Protocols: IPushbackReader, Reader Interfaces: java.io.Closeable SourceLoggingPushbackReadertypeFields: [rdr line column line-start? prev prev-column file-name source-log-frames normalize?] Protocols: IPushbackReader, IndexingReader, Reader Interfaces: java.io.Closeable Public Variables and Functions->IndexingPushbackReaderfunctionUsage: (->IndexingPushbackReader rdr line column line-start? prev prev-column file-name normalize?) Positional factory function for class clojure.tools.reader.reader_types.IndexingPushbackReader.Source ->InputStreamReaderfunctionUsage: (->InputStreamReader is buf) Positional factory function for class clojure.tools.reader.reader_types.InputStreamReader.Source ->PushbackReaderfunctionUsage: (->PushbackReader rdr buf buf-len buf-pos) Positional factory function for class clojure.tools.reader.reader_types.PushbackReader.Source ->SourceLoggingPushbackReaderfunctionUsage: (->SourceLoggingPushbackReader rdr line column line-start? prev prev-column file-name source-log-frames normalize?) Positional factory function for class clojure.tools.reader.reader_types.SourceLoggingPushbackReader.Source ->StringReaderfunctionUsage: (->StringReader s s-len s-pos) Positional factory function for class clojure.tools.reader.reader_types.StringReader.Source indexing-push-back-readerfunctionUsage: (indexing-push-back-reader s-or-rdr)
(indexing-push-back-reader s-or-rdr buf-len)
(indexing-push-back-reader s-or-rdr buf-len file-name)
Creates an IndexingPushbackReader from a given string or PushbackReaderSource indexing-reader?functionUsage: (indexing-reader? rdr) Returns true if the reader satisfies IndexingReaderSource input-stream-push-back-readerfunctionUsage: (input-stream-push-back-reader is)
(input-stream-push-back-reader is buf-len)
Creates a PushbackReader from a given InputStreamSource input-stream-readerfunctionUsage: (input-stream-reader is) Creates an InputStreamReader from an InputStreamSource line-start?functionUsage: (line-start? rdr) Returns true if rdr is an IndexingReader and the current char starts a new lineSource log-sourcemacroUsage: (log-source reader & body) If reader is a SourceLoggingPushbackReader, execute body in a source logging context. Otherwise, execute body, returning the result.Source merge-metafunctionUsage: (merge-meta obj m) Returns an object of the same type and value as `obj`, with its metadata merged over `m`.Source push-back-readerfunctionUsage: (push-back-reader rdr)
(push-back-reader rdr buf-len)
Creates a PushbackReader from a given reader or stringSource read-linefunctionUsage: (read-line)
(read-line rdr)
Reads a line from the reader or from *in* if no reader is specifiedSource source-logging-push-back-readerfunctionUsage: (source-logging-push-back-reader s-or-rdr)
(source-logging-push-back-reader s-or-rdr buf-len)
(source-logging-push-back-reader s-or-rdr buf-len file-name)
Creates a SourceLoggingPushbackReader from a given string or PushbackReaderSource string-push-back-readerfunctionUsage: (string-push-back-reader s)
(string-push-back-reader s buf-len)
Creates a PushbackReader from a given stringSource Copyright 2007-2023 by Rich Hickey and the various contributors
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |