gpt4 book ai didi

ocaml - 如何在 ocaml (toplevel) 中显示长列表

转载 作者:行者123 更新时间:2023-12-01 10:25:03 26 4
gpt4 key购买 nike

我创建了一个列表,其中包含 ocaml 中的很多元素,我想看看里面有什么,但是 ocaml 只显示了其中的一小部分像这样:[e1,e2,e3;...]。如何配置 ocaml 以显示所有内容?

最佳答案

您可以使用 #print_length#print_depth 以交互方式查看更长更深的结构

# #print_depth 0;;
# [1;2;3;4];;
- : int list = [...]

# #print_depth 1;;
# [[1];[2];[3];[4]];;
- : int list list = [[...]; [...]; [...]; [...]]

# #print_length 3;;
# [1;2;3;4];;
- : int list = [1; 2; ...]

关于ocaml - 如何在 ocaml (toplevel) 中显示长列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48046638/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com