static-typing Questions
1
Solved
I would like to create a base struct which have to method, I want to use these methods in the substructs. For example:
type Base struct {
Type string `json:"$type"`
}
func (b Base) GetJSON() ([]...
Germaine asked 11/8, 2017 at 12:58
2
I would like to define two data types in Perl 6 deriving from Int but being incompatible with Int or each other at the same time.
For instance:
Distance derived from Int with a range 0 up to 32000...
Openmouthed asked 1/6, 2017 at 9:45
5
Solved
There's not much info in the spec on what type ascription is, and there certainly isn't anything in there about the purpose for it. Other than "making passing varargs work", what would I use type a...
Escorial asked 18/1, 2010 at 15:51
2
I today learned that dynamically typed programming languages do type checking at run-time as opposed to statically typed languages which do so at Compile-time.(Correct me if I am wrong). What...
Fenelia asked 8/1, 2017 at 13:40
3
Solved
The Unit gets special handling by the compiler when generating byte code because it's analogous to void on the jvm. But conceptually as a type within the scala type system, it seems like it also ge...
Moralize asked 20/12, 2016 at 9:5
5
Solved
Is there any overhead when we cast objects of one type to another? Or the compiler just resolves everything and there is no cost at run time?
Is this a general things, or there are different cases...
Hullo asked 31/1, 2010 at 7:10
1
Solved
I'm puzzled by what I had to do to get this code to work. It seems as if the compiler optimized away a type conversion that I needed, or there's something else I don't understand here.
I have vari...
Milson asked 21/9, 2016 at 0:12
5
Solved
I didn't really pay as much attention to Python 3's development as I would have liked, and only just noticed some interesting new syntax changes. Specifically from this SO answer function parameter...
Rase asked 14/8, 2009 at 1:47
5
Solved
Is there any support for static typing in ECMAScript 6? How about ECMAScript 7?
Robertson asked 14/3, 2014 at 14:25
1
Solved
I ran into the error below while trying to add some flow type checking to one of my test apps.
I don't really understand what it means nor how to fix it.
render(): ?React.Element {
error:
Elem...
Faulkner asked 28/6, 2016 at 14:15
8
Can someone tell me what Strong typing and weak typing means and which one is better?
Thankful asked 27/11, 2008 at 9:36
15
Solved
Can I specify interfaces when I declare a member?
After thinking about this question for a while, it occurred to me that a static-duck-typed language might actually work. Why can't predefined clas...
Shipworm asked 14/11, 2008 at 2:47
2
Solved
I'm trying to understand the benefit of a programming language being statically typed, and through that, I'm wondering why we need to include type in declaration? Does it serve any purpose rather t...
Mickiemickle asked 25/12, 2015 at 6:49
17
Solved
I am a PHP web programmer who is trying to learn C#.
I would like to know why C# requires me to specify the data type when creating a variable.
Class classInstance = new Class();
Why do we need...
Colic asked 13/5, 2009 at 17:5
3
Solved
I'm learning Haskell and trying to grasp how exactly Haskell type system works re working out what is the type of the thing: dynamic, static, set manually, inferred?
Languages I know a bit:
C, J...
Tracay asked 25/9, 2014 at 10:7
6
Solved
Sometimes we have several classes that have some methods with the same signature, but that don't correspond to a declared Java interface. For example, both JTextField and JButton (among several oth...
Communicable asked 17/4, 2011 at 4:24
5
I was reading Paul Graham's "The Hundred-Year Language" article.
http://www.paulgraham.com/hundred.html
In there he makes a claim that static typing "preclude[s] true macros".
For example, typ...
Beatnik asked 17/10, 2009 at 19:46
2
Solved
I'm currently researching ideas for a new programming language where ideally I would like the language to mix some functional and procedural (object oriented) concepts.
One of the things that I'm ...
Corfu asked 20/3, 2014 at 9:26
1
I wish to have a method which has a signature like
method(T1 t1, T2 t2)
such that T2 is-a T1 and/or T1 is-a T2. I do not want the case where T1 and T2 are both a T but where neither is-a the other...
Kantos asked 10/12, 2013 at 18:59
3
Solved
Apparently, with some GHC extensions it is possible to define a type of list that has length encoded in the type, like this:
{-# LANGUAGE GADTs, EmptyDataDecls #-}
data Z
data S a
data List l a ...
Pulsatory asked 4/11, 2013 at 20:33
6
Solved
I know that this may sound like blasphemy to Lisp aficionados (and other lovers of dynamic languages), but how difficult would it be to enhance the Clojure compiler to support static (compile-time)...
Viera asked 15/11, 2010 at 13:10
3
Solved
TYPE& dynamic_cast<TYPE&> (object);
TYPE* dynamic_cast<TYPE*> (object);
For example we can get type like this.
C++ is static typed language, why can we get type at runtime
Lexical asked 24/9, 2013 at 17:18
2
Solved
Okay, so first to get this out of the way: I have read the following answer:
How is Lisp dynamic and compiled?
but I don't really understand its answer.
In a language like Python, the expression...
Godfearing asked 21/8, 2013 at 12:16
3
Solved
I used to think that the answer to this question was "100%", but I've recently been pointed to an example that makes it worth thinking twice. Consider a C array declared as an object with automatic...
Bugg asked 10/4, 2013 at 23:7
4
Solved
I am wondering if there are any statically typed, embeddable scripting languages. Python, JavaScript, etc. are great languages, but they are dynamically typed (that is, types are checked at r...
Propulsion asked 4/4, 2010 at 19:3
© 2022 - 2024 — McMap. All rights reserved.