ifsclimbing

ifsclimbing

[email protected]
🏢  hz
V2EX member #267939, joined on 2017-11-18 19:56:15 +08:00
Per ifsclimbing's settings, the topics list is hidden
Deals info, including closed deals, is not hidden
ifsclimbing's recent replies
没孩子,离婚吧
喜欢过度设计
Mar 26, 2025
Replied to a topic by berrx 职场话题 人工智能会让程序员变得更“傻”么
当年,ide 会让人变傻吗
Feb 26, 2024
Replied to a topic by 21231sv 生活 大家结婚花多少钱
不结婚挺好
Feb 26, 2024
Replied to a topic by HashV2 V2EX 感觉站内技术问题讨论的贴子越来越少了
天天看技术不累吗
来自 GPT 哈哈

兄弟用 elixir 不

https://elixir-lang.org/
好的,看起来你在 Erlang 代码中遇到了一个错误。让我解释一下发生了什么。

在 Erlang 中,当你使用`io:format/2`函数并带有“~p”格式说明符时,它期望一个单一的参数,而不是一个列表。当你尝试使用`io:format("~p~n", A1).`时,它把列表`[1,2,3]`视为三个单独的参数,从而导致错误。

另一方面,当你用`A2=[[1,2,3]].`给`A2`赋了一个嵌套列表,然后使用`io:format("~p~n", A2).`时,它正常工作,因为嵌套列表被视为单个参数。

如果你想使用`io:format/2`打印列表`[1,2,3]`,你应该将列表展平,或者使用`~w`格式说明符,它可以处理列表:

```erlang
A1 = [1, 2, 3],
io:format("~w~n", [A1]).
```

这应该会打印:

```
[1,2,3]
```

或者,你可以展平列表:

```erlang
A1 = [1, 2, 3],
io:format("~p~n", [lists:flatten(A1)]).
```

这也会打印:

```
[1,2,3]
```
Dec 28, 2023
Replied to a topic by K8sCat Python 2024 Python 开发者转型 Go 开发
转啥, 一个程序员不会几门语言吗
asdf + pdm
啥叫适合 Kubernetes
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5737 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 08:36 · PVG 16:36 · LAX 01:36 · JFK 04:36
♥ Do have faith in what you're doing.