09-14-2013, 11:31 AM,
|
|||||
|
|||||
RE: #t , any , Type の違いは?
#t means that the template will substitute in the nullable version of type 't' which you specified when you instantiate the template. (E.g. this is means that if you ask for {DisplayFrame-of String} that field will be #String. For non-class types there is no # variant (#int == int).)
This is different from using 'any' in that the field or argument will be of the specified type, attempting to pass other types will cause a compilation error, and the storage will be the size of that type, and math operators will be natively compiled in the right type. (Note that you could do {DisplayFrame-of any} and lose all of those benefits, but it might be suitable in some cases.) Type means any type can be used, ClassType means that it must be a subclass of Object (anything defined with define-class.) (Type also includes value types and basic types like int.) |
|||||
« Next Oldest | Next Newest »
|
Messages In This Thread |
#t , any , Type の違いは? - by umemura - 09-10-2013, 06:02 PM
RE: #t , any , Type の違いは? - by heavybugtracker - 09-13-2013, 02:52 PM
RE: #t , any , Type の違いは? - by wbardwell - 09-14-2013, 11:31 AM
RE: #t , any , Type の違いは? - by umemura - 09-17-2013, 08:05 PM
|
Possibly Related Threads... | |||||
Thread | Author | Replies | Views | Last Post | |
type-switch で Array-of 、HashTable-of を判別したい | umemura | 2 | 3,824 |
12-28-2012, 01:39 PM Last Post: wbardwell |
Users browsing this thread:
2 Guest(s)
2 Guest(s)