Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
parenscript
parenscript
Commits
eec22d29
Commit
eec22d29
authored
Feb 03, 2015
by
Boris Smilga
Browse files
Added version-string comparison functions.
parent
566d0704
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/compilation-interface.lisp
View file @
eec22d29
(
in-package
#:parenscript
)
(
defparameter
*js-target-version*
1.3
)
(
defparameter
*js-target-version*
"
1.3
"
)
(
defvar
*parenscript-stream*
nil
)
...
...
src/utils.lisp
View file @
eec22d29
...
...
@@ -57,3 +57,32 @@ paren-script becomes parenScript, *some-global* becomes SOMEGLOBAL."
(
or
(
tree-search
A
(
car
x
))
(
unless
(
listp
(
cdr
x
))
(
equal
A
(
cdr
x
))))))))
(
labels
((
compare
(
a
b
op
equality
)
(
if
(
not
(
stringp
a
))
(
setf
a
(
format
nil
"~A"
a
)))
(
if
(
not
(
stringp
b
))
(
setf
b
(
format
nil
"~A"
b
)))
(
loop
with
i
:=
0
and
j
:=
0
and
m
and
n
while
(
or
i
j
)
do
(
multiple-value-setq
(
m
i
)
(
if
(
and
i
(
<
i
(
length
a
)))
(
parse-integer
a
:start
i
:junk-allowed
t
)))
(
multiple-value-setq
(
n
j
)
(
if
(
and
j
(
<
j
(
length
b
)))
(
parse-integer
b
:start
j
:junk-allowed
t
)))
if
(
not
m
)
do
(
setf
m
-1
)
else
do
(
incf
i
)
if
(
not
n
)
do
(
setf
n
-1
)
else
do
(
incf
j
)
do
(
let
((
op-p
(
funcall
op
m
n
))
(
rev-op-p
(
funcall
op
n
m
)))
(
cond
((
and
op-p
(
not
(
and
rev-op-p
equality
)))
(
return
t
))
((
and
rev-op-p
(
not
(
and
op-p
equality
)))
(
return
nil
))
((
and
(
not
(
or
op-p
rev-op-p
))
equality
)
(
return
nil
))))
finally
(
return
equality
))))
(
defun
vstring<
(
a
b
)
(
compare
a
b
#'
<
nil
))
(
defun
vstring<=
(
a
b
)
(
compare
a
b
#'
<=
t
))
(
defun
vstring=
(
a
b
)
(
compare
a
b
#'
=
t
))
(
defun
vstring>=
(
a
b
)
(
compare
a
b
#'
>=
t
))
(
defun
vstring>
(
a
b
)
(
compare
a
b
#'
>
nil
)))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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