问题标签 [fill-pointer]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
1221 浏览

string - How to initialize a string with a fill pointer in Common Lisp?

I want to use formatted output in a loop to generate a string. Manual says it can be easily done by giving format function a string with a fill pointer as a destination. Unfortunately, it is not transparent from the manual how to initialize this string in the first place.

I tried (string "") and (format nil "") with no luck.

(make-array 0 :element-type 'character :fill-pointer 0) did work for me, but it just doesn't feel right.

What is the proper way to initialize a string with a fill pointer?

0 投票
1 回答
108 浏览

arrays - 填充指针会影响GC吗?

如果我有这个结构:

这个数组:

然后执行以下操作:

数组中的现在是fooGC 的候选者吗?

我从 CLHS 了解到它不是active,但我不确定该状态的含义。

0 投票
1 回答
93 浏览

vector - 在结果向量中使用填充指针合并两个向量

我有两个带有填充指针的向量。我需要merge这些向量,因此有一个仍然具有填充指针的新向量。

我似乎找不到要指定合并的类型,以便结果将具有填充指针。我想明显的解决方法是:

  • 自己编写一个merge函数,声明一个新向量并以正确的顺序执行插入。
  • 使用填充指针将结果复制到另一个向量中。

当然,如果有一种方法可以使用merge标准来做到这一点,那么这两种解决方法都非常不令人满意。