R icon indicating copy to clipboard operation
R copied to clipboard

Syntax suggestion to create vector of ints

Open sebffischer opened this issue 1 year ago • 4 comments

I think it would be neat, if [1, 2, 3]L was equivalent to [1L, 2L, 3L].

sebffischer avatar Jul 29 '24 05:07 sebffischer

Otoh, if we want https://github.com/dgkf/R/issues/77, this is not necessary

sebffischer avatar Jul 29 '24 06:07 sebffischer

Do you have a preference @dgkf. Probably I would tend to just make [1, 2, 3] create an integer and [1.0, 2.0, 3.0] a double

sebffischer avatar Jul 29 '24 07:07 sebffischer

Do you have a preference @dgkf. Probably I would tend to just make [1, 2, 3] create an integer and [1.0, 2.0, 3.0] a double

Yeah - I'd prefer not to introduce special syntax for typed vectors. At least not yet. I'm still not confident in which should be the default for parsing int-like numerics. For now, I don't really have a strong preference regarding whether they get first parsed to int or double.

I think int is most intuitive from a developer perspective, but I'd be fine with keeping double by default if there's a meaningful performance rationale for large matrix operations during things like model fitting.

dgkf avatar Jul 29 '24 21:07 dgkf

Ok, let's put this type discussion off for later when we maybe tackle it more wholistically!

sebffischer avatar Jul 30 '24 15:07 sebffischer