Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
abcl
abcl
Commits
6439146f
Commit
6439146f
authored
Aug 19, 2011
by
ehuelsmann@1c010e3e-69d0-11dd-93a8-456734b0d56f
Browse files
Re #116: Implement some infrastructure to load from other sources than
plain java.lang.String-s.
parent
ed085bc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/org/armedbear/lisp/Lisp.java
View file @
6439146f
...
...
@@ -34,14 +34,14 @@
package
org.armedbear.lisp
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.Reader
;
import
java.io.StringReader
;
import
java.math.BigInteger
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.n
et.URLDecoder
;
import
java.n
io.charset.Charset
;
import
java.util.Hashtable
;
public
final
class
Lisp
...
...
@@ -1239,7 +1239,18 @@ public final class Lisp
}
// Used by the compiler.
public
static
final
LispObject
readObjectFromString
(
String
s
)
public
static
LispObject
readObjectFromString
(
String
s
)
{
return
readObjectFromReader
(
new
StringReader
(
s
));
}
final
static
Charset
UTF8CHARSET
=
Charset
.
forName
(
"UTF-8"
);
public
static
LispObject
readObjectFromStream
(
InputStream
s
)
{
return
readObjectFromReader
(
new
InputStreamReader
(
s
));
}
public
static
LispObject
readObjectFromReader
(
Reader
r
)
{
LispThread
thread
=
LispThread
.
currentThread
();
SpecialBindingsMark
mark
=
thread
.
markSpecialBindings
();
...
...
@@ -1253,7 +1264,7 @@ public final class Lisp
// No need to bind the default read table, because the default fasl
// read table is used below
return
new
Str
ingInputStream
(
s
).
read
(
true
,
NIL
,
false
,
return
new
Str
eam
(
Symbol
.
SYSTEM_STREAM
,
r
).
read
(
true
,
NIL
,
false
,
LispThread
.
currentThread
(),
Stream
.
faslReadtable
);
}
...
...
@@ -1261,8 +1272,8 @@ public final class Lisp
thread
.
resetSpecialBindings
(
mark
);
}
}
@Deprecated
@Deprecated
public
static
final
LispObject
loadCompiledFunction
(
final
String
namestring
)
{
Pathname
name
=
new
Pathname
(
namestring
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment