Skip to content

Our printf/sprintf functions are wrong. #66

@skx

Description

@skx

Consider this example:

$ yal -e '(print "Hello user %s you are %d" (getenv "USER") 32)'
Hello user Steve.Kemp you are %!d(string=32)

This is why in our sample-code we basically always use %s - every object is converted to string, via the ToString() method.

booleans, characters, numbers, and strings should be correctly output via %t, %c, %d/%f, or %s as appropriate. Lists? %v I guess?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions