Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
alexandria
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lovrolu
alexandria
Commits
16fabb10
Commit
16fabb10
authored
8 years ago
by
Attila Lendvai
Browse files
Options
Downloads
Patches
Plain Diff
Make (R)CURRY inline-able, and don't locally alter the debug level.
parent
85f82ed8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
functions.lisp
+8
-3
8 additions, 3 deletions
functions.lisp
with
8 additions
and
3 deletions
functions.lisp
+
8
−
3
View file @
16fabb10
...
...
@@ -111,10 +111,12 @@ the last."
(
declare
(
dynamic-extent
arguments
))
,
(
compose-1
funs
))))))
(
declaim
(
inline
curry
rcurry
))
(
defun
curry
(
function
&rest
arguments
)
"Returns a function that applies ARGUMENTS and the arguments
it is called with to FUNCTION."
(
declare
(
optimize
(
speed
3
)
(
safety
1
)
(
debug
1
)))
(
declare
(
optimize
(
speed
3
)
(
safety
1
)))
(
let
((
fn
(
ensure-function
function
)))
(
lambda
(
&rest
more
)
(
declare
(
dynamic-extent
more
))
...
...
@@ -126,19 +128,22 @@ it is called with to FUNCTION."
(
fun
(
gensym
"FUN"
)))
`
(
let
((
,
fun
(
ensure-function
,
function
))
,@
(
mapcar
#'
list
curries
arguments
))
(
declare
(
optimize
(
speed
3
)
(
safety
1
)
(
debug
1
)))
(
declare
(
optimize
(
speed
3
)
(
safety
1
)))
(
lambda
(
&rest
more
)
(
declare
(
dynamic-extent
more
))
(
apply
,
fun
,@
curries
more
)))))
(
defun
rcurry
(
function
&rest
arguments
)
"Returns a function that applies the arguments it is called
with and ARGUMENTS to FUNCTION."
(
declare
(
optimize
(
speed
3
)
(
safety
1
)
(
debug
1
)))
(
declare
(
optimize
(
speed
3
)
(
safety
1
)))
(
let
((
fn
(
ensure-function
function
)))
(
lambda
(
&rest
more
)
(
declare
(
dynamic-extent
more
))
(
multiple-value-call
fn
(
values-list
more
)
(
values-list
arguments
)))))
(
declaim
(
notinline
curry
rcurry
))
(
defmacro
named-lambda
(
name
lambda-list
&body
body
)
"Expands into a lambda-expression within whose BODY NAME denotes the
corresponding function."
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment