#Function.call

1 messages ยท Page 1 of 1 (latest)

split shard
#

@sinful crane, is the cyclic reference a problem or do we have a way of handling that? ObjectTypeDef.Functions: [Function!] โ†” Function.FromType: ObjectTypeDef.

sinful crane
#

We have a similar cyclic reference between Module.Functions <=> Function.ModuleID which is currently handled very painfully

#

What's Function.FromType? don't see that anywhere

#

oh is that what you're adding

split shard
#

Yeah, trying to. I need to know the parent from a Function.call.

sinful crane
#

Can you get away with just an object name instead?

#

We have all the objects defined in full at the top level now, everywhere else is just a reference. (That changed from before)

#

so if you want to keep it an ObjectTypeDef, you can just have it be a reference

sinful crane
split shard
sinful crane
#

I'm not sure if you're familiar with how it used to work, but it used to be like this: Module = [Function(returnTypeDef, argTypeDefs...)]. When a custom type was encountered, the returnTypeDef or argTypeDefs would embed the object definition in full - so with all of its functions attached. But it would only do this the first time it saw that object; the rest would be just references (an ObjectTypeDef with a name but no fields or functions).

Now, it's Module = [Object(fields, functions)] - the functions and fields still embed typeDefs, but now they can always just be references, because all objects are defined in full at the module-level

#

if my ad-hoc syntax makes sense there ๐Ÿ˜…

#

I can hop on a call too if you like

split shard
sinful crane
#

will join dev-audio in a sec!

split shard
#

Fyi, function call is working.

#

Wondering dagger do list vs dagger do --help. Natural since you'll need dagger do message --help to see the arguments. Also avoids conflict with a function named list.

#

Bikeshedding: How about dagger call [function] instead of dagger do [function]? do was used for commands/cli, this way we can keep function calls from the CLI independent to drop call later or use do for something else.

sinful crane
#

nice!

#

I think call is good, it's accurate and just-odd-enough to give us an out to remove/replace it in the future if 'calling functions from the CLI' becomes a thing of the past