[v1] BoundFunc, bind only second arg? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

[v1] BoundFunc, bind only second arg?

14 Dec 2018, 20:49

i want to do this:

Code: Select all

splitByLine := Func("StrSplit").Bind(, "`n")
Array := splitByLine.Call(myText)
is this supported in any way. its ok, if it isnt. just curious

i guess i shouldnt say in any way. wrapper functions need not apply
coffee
Posts: 133
Joined: 01 Apr 2017, 07:55

Re: [v1] BoundFunc, bind only second arg?  Topic is solved

15 Dec 2018, 00:20

Not from what I can see. There's no logic in the bind method to account for that, neither is there in the boundfunc constructor. The boundfunc parameters are simply stored in an autohotkey-type (object::createarray) array in the order they are given. On .call whatever parameters are given are 'merged' after the bound parameters.

Accounting for doing that seems messy. I would say, if it ever happens, it probably won't (or at least shouldn't) be on the bind method, but something else. Since the logic for that can be annoying and even then it may not appease every user's desire to bind at nth parameter, or what to do when nth other parameters have specific values/omitted etc. *shivers* :sick:

Binding
https://github.com/Lexikos/AutoHotkey_L ... .cpp#L2018

Invoking (.call)
https://github.com/Lexikos/AutoHotkey_L ... .cpp#L1986

Passthrough
https://github.com/Lexikos/AutoHotkey_L ... .cpp#L1982

Call, but not call, but still call
https://github.com/Lexikos/AutoHotkey_L ... ct.cpp#L15

Calling
https://github.com/Lexikos/AutoHotkey_L ... .cpp#L1723

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: scriptor2016 and 307 guests