User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:functions:upgraded-array-element-type [2019/11/11 05:00]
cl:functions:upgraded-array-element-type [2019/11/13 17:00] (current)
Line 1: Line 1:
 +====== Function UPGRADED-ARRAY-ELEMENT-TYPE ======
 +
 +====Syntax====
 +  * **upgraded-array-element-type** //typespec ''&​optional''​ environment//​ → //​upgraded-typespec//​
 +
 +====Arguments and Values====
 +  * //​typespec//​ - a //​[[CL:​Glossary:​type specifier]]//​.
 +  * //​environment//​ - an //​[[CL:​Glossary:​environment]]//​ //​[[CL:​Glossary:​object]]//​. The default is **[[CL:​Constant Variables:​nil]]**,​ denoting the //​[[CL:​Glossary:​null lexical environment]]//​ and the current //​[[CL:​Glossary:​global environment]]//​.
 +  * //​upgraded-typespec//​ - a //​[[CL:​Glossary:​type specifier]]//​.
 +
 +====Description====
 +Returns the //​[[CL:​Glossary:​element type]]// of the most //​[[CL:​Glossary:​specialized]]//​ //​[[CL:​Glossary:​array]]//​ representation capable of holding items of the //​[[CL:​Glossary:​type]]//​ denoted by //​typespec//​.
 +
 +The //​typespec//​ is a //​[[CL:​Glossary:​subtype]]//​ of (and possibly //​[[CL:​Glossary:​type equivalent]]//​ to) the //​upgraded-typespec//​.
 +
 +If //​typespec//​ is **[[CL:​Types:​bit]]**,​ the result is //​[[CL:​Glossary:​type equivalent]]//​ to ''​bit''​.
 +
 +If //​typespec//​ is **[[CL:​Types:​base-char]]**,​ the result is //​[[CL:​Glossary:​type equivalent]]//​ to ''​base-char''​.
 +
 +If //​typespec//​ is **[[CL:​Types:​character]]**,​ the result is //​[[CL:​Glossary:​type equivalent]]//​ to ''​character''​.
 +
 +The purpose of **upgraded-array-element-type** is to reveal how an implementation does its //​[[CL:​Glossary:​upgrade|upgrading]]//​.
 +
 +The //​environment//​ is used to expand any //​[[CL:​Glossary:​derived type specifiers]]//​ that are mentioned in the //​typespec//​.
 +
 +====Examples====
 +None.
 +
 +====Side Effects====
 +None.
 +
 +====Affected By====
 +None.
 +
 +====Exceptional Situations====
 +None.
 +
 +====See Also====
 +**[[CL:​Functions:​array-element-type|Function ARRAY-ELEMENT-TYPE]]**,​ **[[CL:​Functions:​make-array|Function MAKE-ARRAY]]**
 +
 +====Notes====
 +Except for storage allocation consequences and dealing correctly with the optional //​environment//​ //​[[CL:​Glossary:​argument]]//,​ **upgraded-array-element-type** could be defined as:
 +
 +<​blockquote> ​
 +([[CL:​Macros:​defun]] upgraded-array-element-type (type &​optional environment) ​
 +  ([[CL:​Functions:​array-element-type]] ([[CL:​Functions:​make-array]] 0 :​element-type type)))
 +</​blockquote>​
 +
 +\issue{SUBTYPEP-ENVIRONMENT:​ADD-ARG} ​
 +\issue{ARRAY-TYPE-ELEMENT-TYPE-SEMANTICS:​UNIFY-UPGRADING} ​
 +\issue{CHARACTER-VS-CHAR:​LESS-INCONSISTENT-SHORT}