HN user

stettberger

170 karma
Posts16
Comments13
View on HN

Sure that is directly possible without further tinkering:

\notebookpage{todo={[bottom,draw]3},fill dotted,paginate}

This will create a dotted page with 3x2 todo notes at the bottom. The todo fields are surrounded by a box (draw), and the page is paginated.

That is very cool! Do you have a link to that implementation? I would be very interested in the problems that arise when you want to provide a rock solid implementation of this.

Hi! Author of DynamicScope<T> here.

Regarding threads: It is correct that the current version of the template has a problem with multi-threaded programs. However, as adding 'thread_local' to the global variable is sufficient to solve the problem, I did not mention this in the original post. However, I updated the blog post in this direction. Furthermore, I added a (run-time) check that ensures that you use DynamicScope<T> only with thread_local.

Regarding Lambdas: I don't think there is a problem here. Dynamically scoped variables promise to return that value that is the most currenly bound in the current execution context. As the resolution is done on dereferencing, this is the exact behavior that DynamicScope<T> provides. This means that a lambda does not (lexically) catch the value of the dynamically-scope variable at definition time, but at the execution time of the lambda.