forked from robert-strandh/SICL
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove copyright notice and untabify.
- Loading branch information
1 parent
b075d1f
commit 568aff7
Showing
3 changed files
with
141 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
;;;; Copyright (c) 2014 | ||
;;;; | ||
;;;; Robert Strandh ([email protected]) | ||
;;;; | ||
;;;; all rights reserved. | ||
;;;; | ||
;;;; Permission is hereby granted to use this software for any | ||
;;;; purpose, including using, modifying, and redistributing it. | ||
;;;; | ||
;;;; The software is provided "as-is" with no warranty. The user of | ||
;;;; this software assumes any responsibility of the consequences. | ||
|
||
(cl:in-package #:sicl-loop) | ||
|
||
(defclass maximize-clause (max/min-accumulation-clause) ()) | ||
|
@@ -32,61 +20,61 @@ | |
|
||
(define-parser maximize-it-into-clause-parser | ||
(consecutive (lambda (maximize it into var type-spec) | ||
(declare (ignore maximize it into)) | ||
(make-instance 'maximize-it-into-clause | ||
:into-var var | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'maximize) | ||
(keyword-parser 'maximizing)) | ||
(keyword-parser 'it) | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))) | ||
'optional-type-spec-parser)) | ||
(declare (ignore maximize it into)) | ||
(make-instance 'maximize-it-into-clause | ||
:into-var var | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'maximize) | ||
(keyword-parser 'maximizing)) | ||
(keyword-parser 'it) | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))) | ||
'optional-type-spec-parser)) | ||
|
||
(define-parser maximize-it-clause-parser | ||
(consecutive (lambda (maximize it type-spec) | ||
(declare (ignore maximize it)) | ||
(make-instance 'maximize-it-clause | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'maximize) | ||
(keyword-parser 'maximizing)) | ||
(keyword-parser 'it) | ||
'optional-type-spec-parser)) | ||
(declare (ignore maximize it)) | ||
(make-instance 'maximize-it-clause | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'maximize) | ||
(keyword-parser 'maximizing)) | ||
(keyword-parser 'it) | ||
'optional-type-spec-parser)) | ||
|
||
(define-parser maximize-form-into-clause-parser | ||
(consecutive (lambda (maximize form into var type-spec) | ||
(declare (ignore maximize into)) | ||
(make-instance 'maximize-form-into-clause | ||
:form form | ||
:into-var var | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'maximize) | ||
(keyword-parser 'maximizing)) | ||
'anything-parser | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))) | ||
'optional-type-spec-parser)) | ||
(declare (ignore maximize into)) | ||
(make-instance 'maximize-form-into-clause | ||
:form form | ||
:into-var var | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'maximize) | ||
(keyword-parser 'maximizing)) | ||
'anything-parser | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))) | ||
'optional-type-spec-parser)) | ||
|
||
(define-parser maximize-form-clause-parser | ||
(consecutive (lambda (maximize form type-spec) | ||
(declare (ignore maximize)) | ||
(make-instance 'maximize-form-clause | ||
:form form | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'maximize) | ||
(keyword-parser 'maximizing)) | ||
'anything-parser | ||
'optional-type-spec-parser)) | ||
(declare (ignore maximize)) | ||
(make-instance 'maximize-form-clause | ||
:form form | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'maximize) | ||
(keyword-parser 'maximizing)) | ||
'anything-parser | ||
'optional-type-spec-parser)) | ||
|
||
(define-parser maximize-clause-parser | ||
(alternative 'maximize-it-into-clause-parser | ||
'maximize-it-clause-parser | ||
'maximize-form-into-clause-parser | ||
'maximize-form-clause-parser)) | ||
'maximize-it-clause-parser | ||
'maximize-form-into-clause-parser | ||
'maximize-form-clause-parser)) | ||
|
||
(add-clause-parser 'maximize-clause-parser) | ||
|
||
|
@@ -99,25 +87,25 @@ | |
`(if (null ,*accumulation-variable*) | ||
(setq ,*accumulation-variable* ,(form clause)) | ||
(setq ,*accumulation-variable* | ||
(max ,*accumulation-variable* ,(form clause))))) | ||
(max ,*accumulation-variable* ,(form clause))))) | ||
|
||
(defmethod body-form ((clause maximize-form-into-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(if (null ,(into-var clause)) | ||
(setq ,(into-var clause) ,(form clause)) | ||
(setq ,(into-var clause) | ||
(max ,(into-var clause) ,(form clause))))) | ||
(max ,(into-var clause) ,(form clause))))) | ||
|
||
(defmethod body-form ((clause maximize-it-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(if (null ,*accumulation-variable*) | ||
(setq ,*accumulation-variable* ,*it-var*) | ||
(setq ,*accumulation-variable* | ||
(max ,*accumulation-variable* ,*it-var*)))) | ||
(max ,*accumulation-variable* ,*it-var*)))) | ||
|
||
(defmethod body-form ((clause maximize-it-into-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(if (null ,(into-var clause)) | ||
(setq ,(into-var clause) ,*it-var*) | ||
(setq ,(into-var clause) | ||
(max ,(into-var clause) ,*it-var*)))) | ||
(max ,(into-var clause) ,*it-var*)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
;;;; Copyright (c) 2014 | ||
;;;; | ||
;;;; Robert Strandh ([email protected]) | ||
;;;; | ||
;;;; all rights reserved. | ||
;;;; | ||
;;;; Permission is hereby granted to use this software for any | ||
;;;; purpose, including using, modifying, and redistributing it. | ||
;;;; | ||
;;;; The software is provided "as-is" with no warranty. The user of | ||
;;;; this software assumes any responsibility of the consequences. | ||
|
||
(cl:in-package #:sicl-loop) | ||
|
||
(defclass minimize-clause (max/min-accumulation-clause) ()) | ||
|
@@ -32,61 +20,61 @@ | |
|
||
(define-parser minimize-it-into-clause-parser | ||
(consecutive (lambda (minimize it into var type-spec) | ||
(declare (ignore minimize it into)) | ||
(make-instance 'minimize-it-into-clause | ||
:into-var var | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'minimize) | ||
(keyword-parser 'minimizing)) | ||
(keyword-parser 'it) | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))) | ||
'optional-type-spec-parser)) | ||
(declare (ignore minimize it into)) | ||
(make-instance 'minimize-it-into-clause | ||
:into-var var | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'minimize) | ||
(keyword-parser 'minimizing)) | ||
(keyword-parser 'it) | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))) | ||
'optional-type-spec-parser)) | ||
|
||
(define-parser minimize-it-clause-parser | ||
(consecutive (lambda (minimize it type-spec) | ||
(declare (ignore minimize it)) | ||
(make-instance 'minimize-it-clause | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'minimize) | ||
(keyword-parser 'minimizing)) | ||
(keyword-parser 'it) | ||
'optional-type-spec-parser)) | ||
(declare (ignore minimize it)) | ||
(make-instance 'minimize-it-clause | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'minimize) | ||
(keyword-parser 'minimizing)) | ||
(keyword-parser 'it) | ||
'optional-type-spec-parser)) | ||
|
||
(define-parser minimize-form-into-clause-parser | ||
(consecutive (lambda (minimize form into var type-spec) | ||
(declare (ignore minimize into)) | ||
(make-instance 'minimize-form-into-clause | ||
:form form | ||
:into-var var | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'minimize) | ||
(keyword-parser 'minimizing)) | ||
'anything-parser | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))) | ||
'optional-type-spec-parser)) | ||
(declare (ignore minimize into)) | ||
(make-instance 'minimize-form-into-clause | ||
:form form | ||
:into-var var | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'minimize) | ||
(keyword-parser 'minimizing)) | ||
'anything-parser | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))) | ||
'optional-type-spec-parser)) | ||
|
||
(define-parser minimize-form-clause-parser | ||
(consecutive (lambda (minimize form type-spec) | ||
(declare (ignore minimize)) | ||
(make-instance 'minimize-form-clause | ||
:form form | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'minimize) | ||
(keyword-parser 'minimizing)) | ||
'anything-parser | ||
'optional-type-spec-parser)) | ||
(declare (ignore minimize)) | ||
(make-instance 'minimize-form-clause | ||
:form form | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'minimize) | ||
(keyword-parser 'minimizing)) | ||
'anything-parser | ||
'optional-type-spec-parser)) | ||
|
||
(define-parser minimize-clause-parser | ||
(alternative 'minimize-it-into-clause-parser | ||
'minimize-it-clause-parser | ||
'minimize-form-into-clause-parser | ||
'minimize-form-clause-parser)) | ||
'minimize-it-clause-parser | ||
'minimize-form-into-clause-parser | ||
'minimize-form-clause-parser)) | ||
|
||
(add-clause-parser 'minimize-clause-parser) | ||
|
||
|
@@ -99,25 +87,25 @@ | |
`(if (null ,*accumulation-variable*) | ||
(setq ,*accumulation-variable* ,(form clause)) | ||
(setq ,*accumulation-variable* | ||
(min ,*accumulation-variable* ,(form clause))))) | ||
(min ,*accumulation-variable* ,(form clause))))) | ||
|
||
(defmethod body-form ((clause minimize-form-into-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(if (null ,(into-var clause)) | ||
(setq ,(into-var clause) ,(form clause)) | ||
(setq ,(into-var clause) | ||
(min ,(into-var clause) ,(form clause))))) | ||
(min ,(into-var clause) ,(form clause))))) | ||
|
||
(defmethod body-form ((clause minimize-it-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(if (null ,*accumulation-variable*) | ||
(setq ,*accumulation-variable* ,*it-var*) | ||
(setq ,*accumulation-variable* | ||
(min ,*accumulation-variable* ,*it-var*)))) | ||
(min ,*accumulation-variable* ,*it-var*)))) | ||
|
||
(defmethod body-form ((clause minimize-it-into-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(if (null ,(into-var clause)) | ||
(setq ,(into-var clause) ,*it-var*) | ||
(setq ,(into-var clause) | ||
(min ,(into-var clause) ,*it-var*)))) | ||
(min ,(into-var clause) ,*it-var*)))) |
Oops, something went wrong.