简体   繁体   中英

What is the top-level of a list?

假设我在scheme中定义了一个列表:(列表(列表1 2)(列表3 4)(列表5 6))顶层是第一个子列表吗?

The top-level list in the example is the list that contains as its three elements (1 2) (3 4) (5 6) . The top-level is not (1 2) - the first sublist: it's the list that contains that sublist. Given that all the list elements in the example are sublists, the top level list in ((1 2) (3 4) (5 6)) is seen as the left-most and right-most parenthesis.

Yes. The top-level are the elements in the list. Some of those elements happen to be lists themselves. In this case, there is only one element, which happens to be a list.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM