Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fare-quasiquote
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
François-René Rideau
fare-quasiquote
Commits
28c55677
Commit
28c55677
authored
4 years ago
by
Masataro Asai
Browse files
Options
Downloads
Patches
Plain Diff
let fare-quasiquote-optima just point to trivia.quasiquote
parent
640d39a0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fare-quasiquote-optima.asd
+1
-2
1 addition, 2 deletions
fare-quasiquote-optima.asd
fare-quasiquote-optima.lisp
+0
-51
0 additions, 51 deletions
fare-quasiquote-optima.lisp
with
1 addition
and
53 deletions
fare-quasiquote-optima.asd
+
1
−
2
View file @
28c55677
...
...
@@ -6,5 +6,4 @@
:version
(
:read-file-line
"version.text"
)
:license
"MIT"
:author
"Francois-Rene Rideau"
:depends-on
(
"fare-quasiquote"
(
:version
"optima"
"1.0"
))
:components
((
:file
"fare-quasiquote-optima"
)))
:depends-on
(
"trivia.quasiquote"
))
This diff is collapsed.
Click to expand it.
fare-quasiquote-optima.lisp
deleted
100644 → 0
+
0
−
51
View file @
640d39a0
;;; -*- Mode: Lisp ; Base: 10 ; Syntax: ANSI-Common-Lisp -*-
;;; optima implementation for fare-quasiquote
;;; Copyright (c) 2002-2014 Fahree Wreido <fare@tunes.org>
#+
xcvb
(
module
(
:depends-on
(
"quasiquote"
(
:asdf
"optima"
))))
(
in-package
:fare-quasiquote
)
(
eval-when
(
:compile-toplevel
:load-toplevel
:execute
)
;; the below instruction enables pattern-matching for the simplifier.
(
macrolet
((
def
(
&rest
x
)
`
(
progn
,@
(
loop
:for
(
a
b
)
:on
x
:by
#'
cddr
:collect
`
(
optima:defpattern
,
a
(
&rest
r
)
`
(
,
',b
,@
r
))))))
(
def
list
cl:list
list*
cl:list*
cons
cl:cons
quote
cl:quote
))
(
optima:defpattern
quasiquote
(
x
)
(
quasiquote-expand
x
))
(
defstruct
(
quasiquote-vector-pattern
(
:include
optima::constructor-pattern
)
(
:constructor
make-quasiquote-vector-pattern
(
content-pattern
&aux
(
optima::subpatterns
(
list
content-pattern
))))))
(
defmethod
optima::constructor-pattern-destructor-sharable-p
((
x
quasiquote-vector-pattern
)
(
y
quasiquote-vector-pattern
))
t
)
(
defmethod
optima::constructor-pattern-make-destructor
((
pattern
quasiquote-vector-pattern
)
var
)
(
optima::make-destructor
:predicate-form
`
(
simple-vector-p
,
var
)
:accessor-forms
(
list
`
(
coerce
,
var
'cl:list
))))
(
defmethod
optima::parse-constructor-pattern
((
name
(
eql
'make-vector
))
&rest
args
)
(
optima:match
args
((
cl:list
(
cl:cons
(
cl:quote
list
)
pats
))
(
apply
#'
optima::make-vector-pattern
(
mapcar
#'
optima::parse-pattern
pats
)))
((
cl:list
pat
)
(
make-quasiquote-vector-pattern
(
optima::parse-pattern
pat
)))
(
otherwise
(
error
"Bad make-vector pattern: ~S"
(
cons
'make-vector
args
)))))
(
defmethod
optima::unparse-pattern
((
pattern
quasiquote-vector-pattern
))
`
(
make-vector
,
(
optima::unparse-pattern
(
first
(
optima::constructor-pattern-subpatterns
pattern
)))))
)
;eval-when
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