The with-cached-reader-conditionals Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The with-cached-reader-conditionals Reference Manual

This is the with-cached-reader-conditionals Reference Manual, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:45:49 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

with-cached-reader-conditionals

Exposes #'call-with-cached-reader-conditionals and the macro with-cached-reader-conditionals

#'call-with-cached-reader-conditionals

Calls the given function with the given args. Returns the first result of the given function as the first result and the returns a list of the 'feature-expression pairs' as the second result.

A 'feature-expression pair' is defined as: A list of length 2 where the first element is a valid lisp feature-expression and the second element is t or nil depending on whether the feature expression succeeded for the current system.

To get the list of features the function rebinds the #+ and #- conditional reader macros so that they will work as normal but also record the feature expressions they are given. This accumulated list of feature expressions is then flattened and deduplicated so only a set of features remain.

with-cached-reader-conditionals

This macro takes it's body, wraps in in a lambda and passes it to #'call-with-cached-reader-conditionals.

Example Usage

    ;; With this function
	(defun test (string)
	  (with-cached-reader-conditionals
		(with-input-from-string (stream string)
		  (loop for l = (read stream nil) while l collect l))))

	;; this call
	CL-USER> (test "(+ 1 2 3)
	#+windows(print 1)
	#+(or sbcl bsd)(print 2)
	#+(or bsd sbcl)(print 3)")

	;; returns these two values
	((+ 1 2 3) (PRINT 2) (PRINT 3))
	(((:OR :BSD :SBCL) T) (:WINDOWS NIL))

Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 with-cached-reader-conditionals

Author

Chris Bagley <chris.bagley@gmail.com>

License

BSD 2 Clause

Description

Read whilst collecting reader conditionals

Source

with-cached-reader-conditionals.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 with-cached-reader-conditionals.asd

Location

with-cached-reader-conditionals.asd

Systems

with-cached-reader-conditionals (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 with-cached-reader-conditionals/package.lisp

Parent

with-cached-reader-conditionals (system)

Location

package.lisp

Packages

with-cached-reader-conditionals


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 with-cached-reader-conditionals/with-cached-reader-conditionals.lisp

Dependency

package.lisp (file)

Parent

with-cached-reader-conditionals (system)

Location

with-cached-reader-conditionals.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 with-cached-reader-conditionals

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Macros

Macro: with-cached-reader-conditionals &body BODY
Package

with-cached-reader-conditionals

Source

with-cached-reader-conditionals.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: call-with-cached-reader-conditionals FUNC &rest ARGS
Package

with-cached-reader-conditionals

Source

with-cached-reader-conditionals.lisp (file)

Function: flatten-features FEATURE-EXPRESSIONS
Package

with-cached-reader-conditionals

Source

with-cached-reader-conditionals.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *keyword-package*
Package

with-cached-reader-conditionals

Source

with-cached-reader-conditionals.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: cached-feature-list CACHE
Package

with-cached-reader-conditionals

Source

with-cached-reader-conditionals.lisp (file)

Function: dirty-featurep X

Ugly in implementation but will always match the implementations logic :|

Package

with-cached-reader-conditionals

Source

with-cached-reader-conditionals.lisp (file)

Function: feature-expr-key EXPR
Package

with-cached-reader-conditionals

Source

with-cached-reader-conditionals.lisp (file)

Function: featurep X
Package

with-cached-reader-conditionals

Source

with-cached-reader-conditionals.lisp (file)

Function: make-reader-conditional-caching-sharp-plus-minus ()
Package

with-cached-reader-conditionals

Source

with-cached-reader-conditionals.lisp (file)

Function: normalize-feature-list PAIRS
Package

with-cached-reader-conditionals

Source

with-cached-reader-conditionals.lisp (file)

Function: sort-feature-expr FEATURE-EXPR
Package

with-cached-reader-conditionals

Source

with-cached-reader-conditionals.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Classes

Class: feature-cache ()
Package

with-cached-reader-conditionals

Source

with-cached-reader-conditionals.lisp (file)

Direct superclasses

standard-object (class)

Direct slots
Slot: cache

Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   W  
Index Entry  Section

F
File, Lisp, with-cached-reader-conditionals.asd: The with-cached-reader-conditionals<dot>asd file
File, Lisp, with-cached-reader-conditionals/package.lisp: The with-cached-reader-conditionals/package<dot>lisp file
File, Lisp, with-cached-reader-conditionals/with-cached-reader-conditionals.lisp: The with-cached-reader-conditionals/with-cached-reader-conditionals<dot>lisp file

L
Lisp File, with-cached-reader-conditionals.asd: The with-cached-reader-conditionals<dot>asd file
Lisp File, with-cached-reader-conditionals/package.lisp: The with-cached-reader-conditionals/package<dot>lisp file
Lisp File, with-cached-reader-conditionals/with-cached-reader-conditionals.lisp: The with-cached-reader-conditionals/with-cached-reader-conditionals<dot>lisp file

W
with-cached-reader-conditionals.asd: The with-cached-reader-conditionals<dot>asd file
with-cached-reader-conditionals/package.lisp: The with-cached-reader-conditionals/package<dot>lisp file
with-cached-reader-conditionals/with-cached-reader-conditionals.lisp: The with-cached-reader-conditionals/with-cached-reader-conditionals<dot>lisp file

Jump to:   F   L   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   D   F   M   N   S   W  
Index Entry  Section

C
cached-feature-list: Internal functions
call-with-cached-reader-conditionals: Exported functions

D
dirty-featurep: Internal functions

F
feature-expr-key: Internal functions
featurep: Internal functions
flatten-features: Exported functions
Function, cached-feature-list: Internal functions
Function, call-with-cached-reader-conditionals: Exported functions
Function, dirty-featurep: Internal functions
Function, feature-expr-key: Internal functions
Function, featurep: Internal functions
Function, flatten-features: Exported functions
Function, make-reader-conditional-caching-sharp-plus-minus: Internal functions
Function, normalize-feature-list: Internal functions
Function, sort-feature-expr: Internal functions

M
Macro, with-cached-reader-conditionals: Exported macros
make-reader-conditional-caching-sharp-plus-minus: Internal functions

N
normalize-feature-list: Internal functions

S
sort-feature-expr: Internal functions

W
with-cached-reader-conditionals: Exported macros

Jump to:   C   D   F   M   N   S   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
C   S  
Index Entry  Section

*
*keyword-package*: Internal special variables

C
cache: Internal classes

S
Slot, cache: Internal classes
Special Variable, *keyword-package*: Internal special variables

Jump to:   *  
C   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   F   P   S   W  
Index Entry  Section

C
Class, feature-cache: Internal classes

F
feature-cache: Internal classes

P
Package, with-cached-reader-conditionals: The with-cached-reader-conditionals package

S
System, with-cached-reader-conditionals: The with-cached-reader-conditionals system

W
with-cached-reader-conditionals: The with-cached-reader-conditionals system
with-cached-reader-conditionals: The with-cached-reader-conditionals package

Jump to:   C   F   P   S   W