英文字典中文字典Word104.com



中文字典辭典   英文字典 a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u   v   w   x   y   z   







請輸入英文單字,中文詞皆可:

tuple    
元組

元組

tuple
有序n 元; n 重序元


tuple
n 倍; n 元組; n 元數; n 元向量


tuple
重元組

tuple


In {functional languages}, a data object containing two or
more components. Also known as a product type or pair,
triple, quad, etc. Tuples of different sizes have different
types, in contrast to lists where the type is independent of
the length. The components of a tuple may be of different
types whereas all elements of a list have the same type.
Examples of tuples in {Haskell} notation are (1,2),
("Tuple",True), (w,(x,y),z). The degenerate tuple with zero
components, written (), is known as the unit type since it has
only one possible value which is also written ().

The implementation of tuples in a language may be either
"{lifted}" or not. If tuples are lifted then (bottom,bottom)
/= bottom and the evaluation of a tuple may fail to terminate.
E.g. in Haskell:

f (x,y) = 1 --> f bottom = bottom
f (bottom,bottom) = 1

With lifted tuples, a tuple pattern is refutable. Thus in
Haskell, {pattern matching} on tuples is the same as pattern
matching on types with multiple constructors ({algebraic data
types}) - the expression being matched is evaluated as far as
the top level constructor, even though, in the case of tuples,
there is only one possible constructor for a given type.

If tuples are unlifted then (bottom, bottom) = bottom and
evaluation of a tuple will never fail to terminate though any
of the components may. E.g. in {Miranda}:

f (x,y) = 1 --> f bottom = 1
f (bottom,bottom) = 1

Thus in Miranda, any object whose type is compatible with a
tuple pattern is assumed to match at the top level without
evaluation - it is an {irrefutable} pattern. This also
applies to user defined data types with only one constructor.
In Haskell, patterns can be made irrefutable by adding a "~"
as in

f ~(x,y) = 1.

If tuple constructor functions were {strict} in all their
arguments then (bottom,x) = (x,bottom) = bottom for any x so
matching a refutable pattern would fail to terminate if any
component was bottom.

請選擇你想看的字典辭典:
單詞字典翻譯
tuple查看 tuple 在Google字典中的解釋Google英翻中〔查看〕
tuple查看 tuple 在Yahoo字典中的解釋Yahoo英翻中〔查看〕





安裝中文字典英文字典查詢工具!


中文字典英文字典工具:
選擇顏色:
輸入中英文單字

































































英文字典中文字典相關資料:
  • python - What is a tuple useful for? - Stack Overflow
    A tuple is a good way to pack multiple values into that cookie without having to define a separate class to contain them I try to be judicious about this particular use, though If the cookies are used liberally throughout the code, it's better to create a class because it helps document their use
  • Whats the difference between lists and tuples? - Stack Overflow
    The PEP 484 -- Type Hints says that the types of elements of a tuple can be individually typed; so that you can say Tuple[str, int, float]; but a list, with List typing class can take only one type parameter: List[str], which hints that the difference of the 2 really is that the former is heterogeneous, whereas the latter intrinsically homogeneous
  • How does tuple comparison work in Python? - Stack Overflow
    Tuples are compared position by position: the first item of the first tuple is compared to the first item of the second tuple; if they are not equal (i e the first is greater or smaller than the second) then that's the result of the comparison, else the second item is considered, then the third and so on See Common Sequence Operations:
  • python - Add another tuple to a tuple of tuples - Stack Overflow
    Build another tuple-of-tuples out of another_choice, then concatenate: final_choices = (another_choice,) + my_choices Alternately, consider making my_choices a list-of-tuples instead of a tuple-of-tuples by using square brackets instead of parenthesis:
  • parsing - Python casting Tuple [int, int] - Stack Overflow
    I have a string "1,2" that I am trying to parse into (1, 2) without simply splitting based on , I was thinking intuitively something along the lines of: from typing import Tuple t = Tuple[int, in
  • floating point - How can I convert a tuple to a float in python . . .
    A tuple is a sequence, just like a list, or any other kind of sequence So, you can index it: >>> a = struct unpack('f', 'helo') >>> b = a[0] >>> b 7 316105495173273e+28
  • types - What are named tuples in Python? - Stack Overflow
    It's a specific subclass of a tuple that is programmatically created to your specification, with named fields and a fixed length This, for example, creates a subclass of tuple, and aside from being of fixed length (in this case, three), it can be used everywhere a tuple is used without breaking This is known as Liskov substitutability
  • How to read a python tuple using PyYAML? - Stack Overflow
    I also wanted to use the tuple syntax, so write tuple: (10,120) instead of writing a list tuple: [10,120] which then gets converted to a tuple, I personally found that very annoying I also did not want to install an external library Here is the code:





中文字典-英文字典  2005-2009

|中文姓名英譯,姓名翻譯 |简体中文英文字典