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
parenscript
parenscript
Commits
7618c052
Verified
Commit
7618c052
authored
Oct 23, 2018
by
Vladimir Sedach
Browse files
Fix MAYBE-ONCE-ONLY to evaluate arguments in order given
parent
1704422e
Changes
2
Show whitespace changes
Inline
Side-by-side
src/compiler.lisp
View file @
7618c052
...
...
@@ -395,5 +395,5 @@ except that if the given VARS are variables or constants, no intermediate variab
(
let
((
var
¹
(
ps-gensym
',var
)))
(
push
(
list
var
¹
,
var
)
,
vars-bound
)
var
¹
)))))
`
(
let
,,
vars-bound
`
(
let
,
(
reverse
,
vars-bound
)
,,@
body
))))
tests/output-tests.lisp
View file @
7618c052
...
...
@@ -4197,3 +4197,15 @@ x = 2 + sideEffect() + x + 5;")
var x1 = callMeOnce();
return (Math.exp(x1) - Math.exp(-x1)) / (Math.exp(x1) + Math.exp(-x1));
})();"
)
(
test-ps-js
maybe-once-only-evaluation-order
(
macrolet
((
A
(
x
y
)
(
maybe-once-only
(
x
y
)
`
(
+
,
x
,
x
,
y
,
y
))))
(
A
(
fun1
)
(
fun2
)))
"(function () {
var x1 = fun1();
var y2 = fun2();
return x1 + x1 + y2 + y2;
})();"
)
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