You can do this:
Code: Select all
Color(alpha: 1, red: 102, green: 205, blue: 170)
Or the Javascript way of forcing the use of an object:
Code: Select all
Color({alpha: 1, red: 102, green: 205, blue: 170}) ; optional * at the end?
Code: Select all
Color(alpha: 1, red: 102, green: 205, blue: 170)
Code: Select all
Color({alpha: 1, red: 102, green: 205, blue: 170}) ; optional * at the end?
Code: Select all
Color(alpha: 1, red: 102, green: 205, blue: 170)
Code: Select all
Color({alpha: 1, red: 102, green: 205, blue: 170}*)
Code: Select all
Color({alpha:=1, red:=102, green:=205, blue:=170})
Code: Select all
Color({alpha=1, red=102, green=205, blue=170})
I want to add 5. :iseahound wrote: ↑11 Sep 2023, 09:551.2.Code: Select all
Color(alpha: 1, red: 102, green: 205, blue: 170)
3.Code: Select all
Color({alpha: 1, red: 102, green: 205, blue: 170}*)
4.Code: Select all
Color({alpha:=1, red:=102, green:=205, blue:=170})
My question: Have you given some thought to the future syntax of named parameters? Since the typing relation could in theory be extended to DllCall("some_fn", a : i32, b : u32). (Not sure)Code: Select all
Color({alpha=1, red=102, green=205, blue=170})
1. Syntax possibly taken by typed properties?
2. Should work.
3. Has side effects. Now red is set to 102 for the rest of the script.
4. = Abandoned since v1
5. Not have named parameters, they really aren't necessary.
Code: Select all
obj1{alpha: 1, red: 102, green: 205, blue: 170}.Color()
{base:obj1,alpha: 1, red: 102, green: 205, blue: 170}.Color()
I like the Function(a:10, b:20) syntax, I would love to see it extended to DllCalls for sure.My question: Have you given some thought to the future syntax of named parameters? Since the typing relation could in theory be extended to DllCall("some_fn", a : i32, b : u32). (Not sure)
1. Syntax possibly taken by typed properties?
2. Should work.
3. Has side effects. Now red is set to 102 for the rest of the script.
4. = Abandoned since v1
5. Not have named parameters, they really aren't necessary.
Code: Select all
color := 'red'
HEX('blue')
msgbox color ; we expect that this should not be changed by the above call
HEX(color: 'red')
msgbox color ; this would be the exact same call, so no side effects should be expected I think
return
HEX(color)
{
switch color
{
case 'red': return 0xFF0000
case 'green': return 0x00FF00
case 'blue': return 0x0000FF
}
}
Code: Select all
; ignore the title parameter
Msgbox(text: "This is a test", options: "Iconi")
; invert the title and text parameters cause i like it that way
Msgbox(title: "error", text: "this is an error")
; not sure if mixing named parameters with positional parameters is feasible though, just a nice wish
; the third parameter is in the correct position, so i wouldnt need to name it.
msgbox(title: "a nice title", text: "some text", "iconX")
Code: Select all
; SplitPath path,,&oDir,,,&oDrive <-- I really hate this
SplitPath path, Dir: &oDir, Drive: &oDrive ; <--- wouldnt this be awesome?