typechecking
Check if something is a list
What is the easiest way to check if something is a list? A method doSomething has the parameters a and b. In the method, it will loop through the list a and do something. I\'d like a way to make sure[详细]
2022-12-26 18:39 分类:问答C++ type-checking at compile-time
all. I\'m pretty new to C++, and I\'m writing a small library (mostly for my own 开发者_开发百科projects) in C++. In the process of designing a type hierarchy, I\'ve run into the problem of defining t[详细]
2022-12-26 05:43 分类:问答Is checking Perl function arguments worth it?
There\'s a lot of buzz about MooseX::Method::Signatures and even before that, modules su开发者_运维百科ch as Params::Validate that are designed to type check every argument to methods or functions. I\[详细]
2022-12-21 00:07 分类:问答Somehow not assigning a class with Ruby
On runtime, my code often come into an undefined method error for the method mate. As far as I can figure, a Person somehow slips through the cracks sometime along the code\'s exucution, and manages n[详细]
2022-12-19 05:49 分类:问答Checking type parameter of a generic method in C#
Is it possible to do something like this in C#: public void DoSomething<T>(T t) { if (T is MyClass)[详细]
2022-12-15 23:00 分类:问答Is there a way to enforce runtime type-checking in Objective-C on Cocoa?
Hi I\'m finding a way to enforce runtime type checking or such things in Objective-C on Cocoa. This is my code sample.[详细]
2022-12-15 20:12 分类:问答Is there a way to have SQL server validate object references in Stored Procs?
The following code executes fine in SQL Server create proc IamBrokenAndDontKnowIt as select * from tablewhichdoesnotexist[详细]
2022-12-15 11:52 分类:问答Is it Pythonic to check function argument types?
I know, type checking function arguments is generally frowned upon in Python, but I think I\'ve come up with a situation where it makes sense to do so.[详细]
2022-12-14 13:13 分类:问答Java snippet that causes stack overflow in the compiler or typechecker (javac)?
Yesterday at a seminar the presenter (Peter Sestoft) showed a small java program, with 3 classes, featuring both co-variance and contra-variance. When attempting to compile using javac, the type check[详细]
2022-12-12 17:15 分类:问答Subclass check, is operator or enum check
A couple of friends was discussing the use of inheritance and how to check if a subclass is of a specific type and we decided to post it here on Stack. The debate was about if you should implement a a[详细]
2022-12-11 07:35 分类:问答