stdlib/string: 补组合操作 rwfunc + string·parsefloat(#157) - #343
Merged
Merged
Conversation
string 库此前只有 native rwir 一层,本次补上**组合操作**层,命名取 C/Python/Rust/TypeScript/Go 五语言共识名: - 查/比:eqfold、count、rfind - 修剪:trim、trimstart、trimend、padstart、padend - 切分/拼接:split、splitn、lines、fields、join、cut - 替换:replace、replacen - 大小写:capitalize、title、swapcase - 判定:isalpha/isdigit/isalnum/isxdigit/isspace/isupper/islower/ispunct、allinset 另新增 native rwir **string·parsefloat**(对齐 Go strconv.ParseFloat / Python float() / Rust parse::<f64>()):整串须消费完,否则 ValueError。 配套:runtime/rwir_string.c 实现、myrwircaps 注册、rwir_internal.h 原型、 layout/lower.rs 返回类型推断(→ float64)。 tutorial:新增 13-stdlib/string/03-search…07-classify,11-string/08-strconv 跟随调整;kvlangbrief 速览同步。 Closes #157 Co-Authored-By: Claude Code <noreply@anthropic.com>
native rwir(字节级,runtime-rs:size/read/write/append/list/del/mkdir/ exists)之上补文本级组合: - readtext / writetext 文件 ↔ []char/utf32 文本(UTF-8 解码/编码往返) - match 名字段 shell 通配(* 任意串、? 单字符) - glob 按通配展开路径 - grep 逐行查找(文件或目录下匹配 glob 的成员) - multi 事务式多处编辑(逐条精确替换,全部成功才落盘) 文本约定:按 UTF-8 解码为 []char/utf32 后操作(只有定宽 char/utf32 可索引 /切片),落盘再编码回 UTF-8;字节级 I/O 仍走 native rwir。 tutorial:新增 14-networld/11-fs-text。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更
1.
stdlib/string补组合操作层(Closes #157)此前只有 native rwir 一层,本次补上组合操作,命名取 C/Python/Rust/TypeScript/Go 五语言共识名:
eqfoldcountrfindtrimtrimstarttrimendpadstartpadendsplitsplitnlinesfieldsjoincutreplacereplacencapitalizetitleswapcaseisalphaisdigitisalnumisxdigitisspaceisupperislowerispunctallinset另新增 native rwir
string·parsefloat(对齐 Gostrconv.ParseFloat/ Pythonfloat()/ Rustparse::<f64>())——整串须消费完,否则ValueError。配套 runtime 实现 + myrwircaps 注册 +rwir_internal.h原型 + layout 返回类型推断。2.
stdlib/networld新增fs库native rwir(字节级)之上补文本级组合:
readtext/writetext(UTF-8 往返)、match(shell 通配)、glob、grep、multi(事务式多处编辑,全部成功才落盘)。tutorial
新增
13-stdlib/string/03-search…07-classify、14-networld/11-fs-text;11-string/08-strconv跟随调整。Closes #157
🤖 Generated with Claude Code