You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example in python you can use the * operator like x(*array) which translates to expanding the array as if it was a series of arguments i.e. the following;
arr= [1, 2, 3]
x(arr) # is just x( [1, 2, 3] )x(*arr) # is x( 1, 2, 3 ) - note how the 'array' is gone
Since definitions don't allow multiple arguments due to their nature of being able to be typed i.e. arr : []int = [1, 2, 3] should we be able to 'not type' them (thus allowing the values to not conform to the type UNTIL they are used in a function call) then later 'unfold' them i.e.
arr := [1, 2, 3, 5.0, true]
A.x=arr// error: not all types are the sameA.x=*arr// perfectly fine is just the same as A.x = 1, 2, 3, 5.0, true
Now the question is also what should the syntax be, I don't particularly like the * as it is too close to the pointer syntax in languages for my liking; I would prefer a more 'slice' based syntax i.e. arr[..]. This would fit the similar syntax of the proposed slices (#11 ).
The text was updated successfully, but these errors were encountered:
For example in python you can use the
*
operator likex(*array)
which translates to expanding the array as if it was a series of arguments i.e. the following;Since definitions don't allow multiple arguments due to their nature of being able to be typed i.e.
arr : []int = [1, 2, 3]
should we be able to 'not type' them (thus allowing the values to not conform to the type UNTIL they are used in a function call) then later 'unfold' them i.e.Now the question is also what should the syntax be, I don't particularly like the
*
as it is too close to the pointer syntax in languages for my liking; I would prefer a more 'slice' based syntax i.e.arr[..]
. This would fit the similar syntax of the proposed slices (#11 ).The text was updated successfully, but these errors were encountered: