vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.5k stars 2.15k forks source link

builtin.string.camel_to_snake need improve #21716

Closed kbkpbot closed 3 days ago

kbkpbot commented 6 days ago

Describe the feature

Currently, 'JVM_PUBLIC_ACC'.camel_to_snake() will create 'j_vm_public_acc'

I do think it is better create 'jvm_public_acc'

Use Case

assert 'JVM_PUBLIC_ACC'.camel_to_snake() == 'jvm_public_acc'

Proposed Solution

No response

Other Information

No response

Acknowledgements

Version used

V full version: V 0.4.6 7d182a4.d364e61

Environment details (OS name and version, etc.)

V full version: V 0.4.6 7d182a4.d364e61 OS: linux, Ubuntu 22.04.4 LTS Processor: 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz

getwd: /home/mars/v/9 vexe: /media/HD/github/kbkpbot/v/v vexe mtime: 2024-06-23 08:38:28

vroot: OK, value: /media/HD/github/kbkpbot/v VMODULES: OK, value: /home/mars/.vmodules VTMP: OK, value: /tmp/v_1000

Git version: git version 2.34.1 Git vroot status: weekly.2024.09-653-gd364e61b .git/config present: true

CC version: cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 thirdparty/tcc status: thirdparty-linux-amd64 40e5cbb5-dirty

[!NOTE] You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.

spytheman commented 3 days ago

I think that c5c49d3 fixes this issue.