kellysmith12.21
2021-1-11 19:10:07

I checked how Python handles kwarg passing, and it only allows dictionaries with string keys.


kellysmith12.21
2021-1-11 19:15:43

I think a good solution for my lang would be to permit passing kwargs with generic, immutable dictionaries whose keys are either keywords, symbols, or strings.


sorawee
2021-1-11 19:18:03

> whose keys are either keywords, symbols, or strings why?


kellysmith12.21
2021-1-11 19:23:55

It’s easy to convert symbols and strings into keywords with predictable results, so I think allowing them as keys in a “kwarg dictionary” would make the process of kwarg passing a little more convenient.


kellysmith12.21
2021-1-11 19:42:15

I don’t know if that’s a good argument.


notjack
2021-1-11 20:47:07

I can’t recall a time I actually wanted to pass a dictionary of keyword arguments along.


notjack
2021-1-11 20:47:26

though I do think there are uses for it


kellysmith12.21
2021-1-11 20:53:10

Using a kwarg dictionary is just a way of abstracting over keyword-apply.


kellysmith12.21
2021-1-11 20:54:58

The called procedure doesn’t actually get a dictionary, it just receives the keyword arguments normally.


notjack
2021-1-11 20:56:31

kellysmith12.21
2021-1-11 20:59:36

Hm, that does make manipulating arguments for wrappers and whatnot easier.



notjack
2021-1-11 21:01:41

thank @alexknauth for that one :)