Skip to content

Instantly share code, notes, and snippets.

@guicho271828
Last active June 27, 2020 19:56
Show Gist options
  • Save guicho271828/15162239f3a3bdb203c54392b0d64e04 to your computer and use it in GitHub Desktop.
Save guicho271828/15162239f3a3bdb203c54392b0d64e04 to your computer and use it in GitHub Desktop.
Fun-info attributes in SBCL
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
*yyyyy
+yyyyy
-yyyy
/yyy
/=yyyy
1+yyyy
1-yyyy
<yyyyy
<=yyyy
=yyyyyy
>yyyyy
>=yyyy
abortyy
absyyyy
aconsyyy
acosyyyyy
acoshyyyyy
adjoinyyy
adjustable-array-pyyyy
alpha-char-pyyyy
alphanumericpyyyy
appendyy
applyyy
aproposyy
apropos-listyyy
arefy
array-dimensionyyy
array-dimensionsyyy
array-element-typeyyy
array-has-fill-pointer-pyyyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
array-in-bounds-pyyy
array-rankyyy
array-row-major-indexyyy
array-total-sizeyyy
arraypyyyyy
ashyyyy
asinyyyyy
asinhyyyyy
assocyyyy
assoc-ifyyyy
assoc-if-notyyyy
atanyyyy
atanhyyyyy
atomyyyy
bityyy
bit-vector-pyyyyy
booleyyyy
both-case-pyyyy
boundpyyy
breakyy
butlastyy
byteyyyy
byte-positionyyyy
byte-sizeyyyy
caaaaryy
caaadryy
caaaryy
caadaryy
caaddryy
caadryy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
caaryy
cadaaryy
cadadryy
cadaryy
caddaryy
cadddryy
caddryy
cadryy
caryyy
cdaaaryy
cdaadryy
cdaaryy
cdadaryy
cdaddryy
cdadryy
cdaryy
cddaaryy
cddadryy
cddaryy
cdddaryy
cddddryy
cdddryy
cddryy
cdryyy
ceilingyyyy
cerroryy
charyyy
char-codeyyyy
char-downcaseyyyy
char-equalyyyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
char-greaterpyyyy
char-intyyyy
char-lesspyyyy
char-nameyyyy
char-not-equalyyyy
char-not-greaterpyyyy
char-not-lesspyyyy
char-upcaseyyyy
char/=yyyy
char<yyyyy
char<=yyyy
char=yyyyyy
char>yyyyy
char>=yyyy
characteryyy
characterpyyyyy
cisyyyy
class-nameyy
class-ofyy
code-charyyyy
coercey
compileyy
compile-fileyy
compile-file-pathnameyy
compiled-function-pyyyy
compiler-macro-functionyy
complementyyy
complexyyyy
complexpyyyyy
compute-restartsyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
conjugateyyyy
consyyy
conspyyyyy
constantlyyyy
constantpyyy
continueyy
copy-alistyy
copy-listyy
copy-seqyy
copy-structureyy
copy-symbolyy
copy-treeyyy
cosyyyyy
coshyyyyy
countyyyy
count-ifyyyy
count-if-notyyyy
decode-floatyyy
decode-universal-timeyy
deleteyyyy
delete-duplicatesyyy
delete-fileyy
delete-ifyyyy
delete-if-notyyyy
denominatoryyyy
deposit-fieldyyyy
describeyy
digit-charyyyy
digit-char-pyyyy
directory-namestringy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
disassembleyy
dpbyyyy
dribbleyy
edyy
eighthyy
eltyy
encode-universal-timeyy
endpyyyy
enough-namestringy
eqyyyyyy
eqlyyyyyy
equalyyyy
equalpyyyy
erroryy
evaly
evenpyyyy
everyyyy
expyyyyy
exportyy
exptyyyyy
fboundpy
fceilingyyyy
fflooryyyy
fifthyy
file-lengthy
file-namestringy
file-positionyy
file-string-lengthyy
fill-pointery
findyyyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
find-all-symbolsyy
find-ifyyyy
find-if-notyyyy
find-packageyy
find-restartyy
find-symbolyy
firstyyy
floatyyyy
float-digitsyyy
float-precisionyyy
float-radixyyy
float-signyyy
floatpyyyyy
flooryyyy
fourthyy
froundyyyy
ftruncateyyyy
funcallyy
function-lambda-expressionyy
functionpyyyyy
gcdyyyy
gentempyy
getyy
get-decoded-timeyy
get-internal-real-timeyy
get-internal-run-timeyy
get-macro-characteryy
get-propertiesyyy
get-universal-timeyy
getfyyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
gethashyy
graphic-char-pyyyy
hash-table-countyy
hash-table-pyyyy
hash-table-rehash-sizeyyy
hash-table-rehash-thresholdyyy
hash-table-sizeyy
hash-table-testyyy
host-namestringy
identityyyyy
imagpartyyyy
importyy
inspectyy
integer-decode-floatyyy
integer-lengthyyyy
integerpyyyyy
intersectionyyyy
invalid-method-erroryy
invoke-debuggeryy
invoke-restartyy
invoke-restart-interactivelyyy
isqrtyyyyy
keywordpyy
lastyyy
lcmyyyy
ldbyyyy
ldb-testyyyy
ldiffyy
lengthyyyy
lisp-implementation-typeyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
lisp-implementation-versionyy
listyyy
list*yyy
list-all-packagesyy
list-lengthyy
listenyy
listpyyyyy
loadyy
logyyyyy
logandyyyyy
logandc1yyyy
logandc2yyyy
logbitpyyyy
logcountyyyy
logeqvyyyyy
logioryyyyy
lognandyyyy
lognoryyyy
lognotyyyy
logorc1yyyy
logorc2yyyy
logtestyyyyyy
logxoryyyyy
long-site-nameyy
lower-case-pyyyy
machine-instanceyy
machine-typeyy
machine-versionyy
macro-functionyy
macroexpandyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
macroexpand-1yy
make-arrayyy
make-broadcast-streamy
make-concatenated-streamy
make-echo-streamyy
make-hash-tableyy
make-listyyy
make-packageyy
make-pathnamey
make-random-stateyy
make-sequencey
make-stringyy
make-string-input-streamyy
make-string-output-streamyy
make-symbolyy
make-synonym-streamyy
make-two-way-streamy
mapy
map-intoy
mapcyy
mapcany
mapcary
mapcony
maphashyyy
maplyy
maplisty
mask-fieldyyyy
maxyyyy
memberyyyy
member-ifyyyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
member-if-notyyyy
mergeyy
method-combination-erroryy
minyyyy
minuspyyyy
mismatchyyyy
modyyyy
muffle-warningyy
name-charyyyy
namestringy
nintersectionyyyyy
ninthyy
notyyyy
notanyyyy
noteveryyyy
nreconcy
nreversey
nset-differenceyyyyy
nset-exclusive-oryyyyy
nsublisyyy
nsubsty
nsubst-ify
nsubst-if-noty
nsubstituteyyy
nsubstitute-ifyyy
nsubstitute-if-notyyy
nthyyy
nthcdryy
nullyyyy
numberpyyyyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
numeratoryyyy
nunionyyyyy
oddpyyyy
openyy
open-stream-pyy
package-namey
package-nicknamesy
package-shadowing-symbolsy
package-use-listy
package-used-by-listy
packagepyyyy
pairlisyy
parse-integeryy
parse-namestringy
pathname-deviceyy
pathname-directoryyy
pathname-hostyy
pathname-nameyy
pathname-typeyy
pathname-versionyy
pathnamepyyy
phaseyyyy
pluspyyyy
positionyyyy
position-ifyyyy
position-if-notyyyy
prin1yy
prin1-to-stringyy
princyy
princ-to-stringyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
printyy
proclaimy
random-state-pyyyy
rassocyyyy
rassoc-ifyyyy
rassoc-if-notyyyy
rationalyyyy
rationalizeyyyyy
rationalpyyyyy
read-from-stringyy
readtablepyyyy
realpyyyyy
realpartyyyy
reduceyyyy
remyyyy
removeyyy
remove-duplicatesyy
remove-ifyyy
remove-if-notyyy
rempropyy
rename-fileyy
rename-packageyy
restyyy
restart-nameyy
revappendyy
reverseyy
roomyy
roundyyyy
row-major-arefy
sbityyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
scale-floatyyy
scharyyy
searchyyyy
secondyy
set-differenceyyyy
set-exclusive-oryyyy
set-macro-charactery
seventhyy
shadowyy
shadowing-importyy
short-site-nameyy
signalyy
signumyyyy
simple-bit-vector-pyyyyy
simple-string-pyyyyy
simple-vector-pyyyyy
sinyyyyy
sinhyyyyy
sixthyy
slot-boundpyy
slot-exists-pyy
slot-valueyy
software-typeyy
software-versionyy
someyyy
sorty
special-operator-pyyyy
sqrtyyyy
stable-sorty
standard-char-pyyyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
store-valueyy
stream-external-formatyy
streampyyyy
stringyy
string-capitalizeyy
string-downcaseyy
string-equalyyy
string-greaterpyyy
string-left-trimyy
string-lesspyyy
string-not-equalyyy
string-not-greaterpyyy
string-not-lesspyyy
string-right-trimyy
string-trimyy
string-upcaseyy
string/=yyy
string<yyy
string<=yyy
string=yyy
string>yyy
string>=yyy
stringpyyyyy
sublisyyy
subseqyy
subsetpyyyy
substyyy
subst-ifyyy
subst-if-notyyy
substituteyyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
substitute-ifyyy
substitute-if-notyyy
subtypepy
svrefyyy
sxhashyyy
symbol-nameyyyy
symbol-packageyy
symbol-plistyy
symbolpyyyyy
tailpyyy
tanyyyyy
tanhyyyyy
tenthyy
thirdyy
translate-logical-pathnamey
tree-equalyyyy
truncateyyyyy
type-ofyyy
typepy
unexportyy
uninternyy
unionyyyy
unuse-packageyy
upgraded-array-element-typey
upgraded-complex-part-typey
upper-case-pyyyy
use-packageyy
use-valueyy
user-homedir-pathnameyy
valuesyyy
namedxcomvopfldflsuflsmovpredicatecalluwimprecany
values-listyyy
vectoryy
vectorpyyyyy
warnyy
wild-pathname-py
writeyy
write-to-stringy
zeropyyyy
(!def-boolean-attribute ir1
;; may call functions that are passed as arguments. In order to
;; determine what other effects are present, we must find the
;; effects of all arguments that may be functions.
call
;; may fail to return during correct execution. Errors are O.K.
;; UNUSED, BEWARE OF BITROT.
unwind
;; the (default) worst case. Includes all the other bad things, plus
;; any other possible bad thing. If this is present, the above bad
;; attributes will be explicitly present as well.
any
;; all arguments are safe for dynamic extent.
;; (We used to have an UNSAFE attribute, which was basically the inverse
;; of this, but it was unused and bitrotted, so when we started making
;; use of the information we flipped the name and meaning the safe way
;; around.)
dx-safe
;; may be constant-folded. The function has no side effects, but may
;; be affected by side effects on the arguments. e.g. SVREF, MAPC.
;; Functions that side-effect their arguments are not considered to
;; be foldable. Although it would be "legal" to constant fold them
;; (since it "is an error" to modify a constant), we choose not to
;; mark these functions as foldable in this database.
foldable
;; may be eliminated if value is unused. The function has no side
;; effects except possibly cons. If a function might signal errors,
;; then it is not flushable even if it is movable, foldable or
;; unsafely-flushable. Implies UNSAFELY-FLUSHABLE. (In safe code
;; type checking of arguments is always performed by the caller, so
;; a function which SHOULD signal an error if arguments are not of
;; declared types may be FLUSHABLE.)
flushable
;; unsafe call may be eliminated if value is unused. The function
;; has no side effects except possibly cons and signalling an error
;; in the safe code. If a function MUST signal errors, then it is
;; not unsafely-flushable even if it is movable or foldable.
unsafely-flushable
;; return value is important, and ignoring it is probably a mistake.
;; Unlike the other attributes, this is used only for style
;; warnings and has no effect on optimization.
important-result
;; may be moved with impunity. Has no side effects except possibly
;; consing, and is affected only by its arguments.
;; UNUSED, BEWARE OF BITROT.
movable
;; The function is a true predicate likely to be open-coded. Convert
;; any non-conditional uses into (IF <pred> T NIL). Not usually
;; specified to DEFKNOWN, since this is implementation dependent,
;; and is usually automatically set by the DEFINE-VOP :CONDITIONAL
;; option.
predicate
;; Inhibit any warning for compiling a recursive definition.
;; (Normally the compiler warns when compiling a recursive
;; definition for a known function, since it might be a botched
;; interpreter stub.)
recursive
;; The function should always be translated by a VOP (i.e. it should
;; should never be converted into a full call). This is used strictly
;; as a consistency checking mechanism inside the compiler during IR2
;; transformation.
always-translatable
;; If a function is called with two arguments and the first one is a
;; constant, then the arguments will be swapped.
commutative)
#!/bin/sh
#|-*- mode:lisp -*-|#
#| <Put a one-line description here>
exec ros -Q -- $0 "$@"
|#
(progn ;;init forms
(ros:ensure-asdf)
#+quicklisp (ql:quickload '(anaphora iterate alexandria) :silent t)
)
(defpackage :ros.script.list-attributes.3693956474
(:use :cl :anaphora :iterate :alexandria))
(in-package :ros.script.list-attributes.3693956474)
(defun main (&optional (pkg "CL") &rest argv)
(declare (ignorable argv))
(let* ((names (sort (iter (for name in-package pkg)
(collect name))
#'string<))
(name-width (reduce #'max names :key (compose #'length #'string)))
(attrs
'((dx-safe dx)
(commutative com)
(always-translatable vop)
(foldable fld)
(flushable fls)
(unsafely-flushable ufls)
(movable mov)
(predicate predicate)
(call call)
(unwind uw)
(important-result imp)
(recursive rec)
(any any))))
(iter (for name in names)
(generate i from 0)
(awhen (SB-INT:INFO :function :info name)
(awhen (sb-c::decode-ir1-attributes (sb-c::fun-info-attributes it))
(next i)
(when (zerop (rem i 30))
(format t "~2%~(~v@a, ~{~a~^, ~}~)~%" name-width :name (mapcar #'second attrs)))
(format t "~(~v@a, ~{~a~^, ~}~)~%"
name-width name
(iter (for attr in (mapcar #'first attrs))
(collect
(if (member attr it :test #'string-equal)
"y"
"")))))))))
;; (IR1 CALL UNWIND ANY DX-SAFE FOLDABLE FLUSHABLE
;; UNSAFELY-FLUSHABLE IMPORTANT-RESULT MOVABLE PREDICATE RECURSIVE
;; ALWAYS-TRANSLATABLE COMMUTATIVE)
;;; vim: set ft=lisp lisp:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment