All Questions
729
questions
-2
votes
0
answers
80
views
Are there objects for primitive data types? [duplicate]
If the object represents a data type, is the variable for a primitive data type like an integer also an object representing this type, or do objects not represent primitive data types?
// Let's assume ...
1
vote
1
answer
95
views
How to overload a procedure declared in an abstract type in fortran?
In the following module, an abstract type (Base_Arrays_class) is declared and two types are derived (One_Array_t and Two_Arrays_t). In the abstract type, there is a procedure abstract_init deferred to ...
0
votes
1
answer
31
views
Pass an array of types as function param and check if a concrete object inherits any type from array in Swift?
In my particular case I need to get the topmost view controller but avoid view controllers of some types like UIAlertController. I took code from here:
extension UIViewController {
func ...
2
votes
0
answers
70
views
How to detect classes marked with file modifier in C#
In C# 11, the new file type modifier was introduced.
I was looking for a way to detect such non-public type using reflection, however, I have not find any "good" way to do so.
There is no Is…...
0
votes
1
answer
27
views
Object belongs to class and has property in typescript?
import type { Scene, Camera } from 'three'
interface SceneWithActiveCamera extends Scene {
activeCamera: Camera
}
let scene: SceneWithActiveCamera
Is there a simpler way to do this? For example, ...
3
votes
1
answer
440
views
How to load the classes in PowerShell module globally?
I've already read this question and even though it has lots of back and forth, I tried my best to follow the suggestions, but still not sure how to work around this.
I have defined multiple classes in ...
1
vote
0
answers
34
views
Python relation between object and type [duplicate]
After sometimes spent on writing small Python scripts, I started to try to learn it more formally.
I've this code :
class One(object):
pass
print(One, type(One))
class Two(type):
...
-2
votes
2
answers
72
views
creating a primitive type with a class constructor in javascript
Is there any possibility to define or extend a class for a primitive type like string, number or array? For example i would like to define a Name-class which I can construct with new Name() and just ...
1
vote
1
answer
105
views
Inherit and modify methods from a parent class at run time in Python
I have a parent class of which I don't know the methods a priori. Its methods can do arbitrary things such as modifying attributes of the class.
Say:
class Parent():
def __init__(self):
...
0
votes
0
answers
45
views
Is class can declared as type for a variable in Kotlyn
class SmartTvDevice : SmartDevice() {
}
// The SmartHome class HAS-A smart TV device.
class SmartHome(val Device: SmartTvDevice) {
}
Hi I am learning Kotlyn. I have a question in above syntax (val ...
-1
votes
1
answer
27
views
Referencing a downstream class in type hinting for a class method
I am building a python game using pygame. Struggling a bit to add typing to things. I have a abstract group class Mobs which I define with:
class Mobs(pygame.sprite.Group):
I then create individual ...
0
votes
0
answers
25
views
C code is giving errors saying I should use a class type
I am rewriting some image processing code, and I am getting strange errors.
The errors are all "expression must have class type but it has type "unsigned char *"
Note that this is C ...
1
vote
1
answer
92
views
Nested class of a template class - interoperability and visibility
I have a template class A<T> with a nested class Inner - I use it to hide implementation details. I might have different instantiations of the class A. A can hold a pointer to Inner and I might ...
0
votes
2
answers
53
views
Creating a loop for protocol-type array
I have this code:
protocol Animal {
var type: String {get}
}
struct Dog: Animal {
var name: String
var type: String
func bark() {
print("Woof!")
}
}
struct ...
0
votes
1
answer
56
views
Clarifying some relationships between types, upcasting, and classes/interfaces [duplicate]
Everything occurs in Java. I'm not sure to what extent the programming language affects my questions, and I would be interested to know.
Suppose I have a class Animal, and a subclass which extends ...