autoc 1.1 → 1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -148,64 +148,67 @@ class HashSet < Collection
148
148
  def initialize(*args)
149
149
  super
150
150
  @list = List.new(list, element, :static)
151
+ @capability.subtract [:orderable]
152
+ key_type_check(element)
151
153
  end
152
154
 
153
- def write_exported_types(stream)
155
+ def write_intf_types(stream)
154
156
  stream << %$
155
157
  /***
156
158
  **** #{type}<#{element.type}> (#{self.class})
157
159
  ***/
158
160
  $ if public?
159
- @list.write_exported_types(stream)
161
+ @list.write_intf_types(stream)
160
162
  stream << %$
161
163
  typedef struct #{type} #{type};
162
164
  typedef struct #{it} #{it};
163
165
  struct #{type} {
164
- #{@list.type}* buckets;
166
+ #{@list.type_ref} buckets;
165
167
  size_t bucket_count, min_bucket_count;
166
168
  size_t size, min_size, max_size;
167
169
  unsigned min_fill, max_fill, capacity_multiplier; /* ?*1e-2 */
168
170
  };
169
171
  struct #{it} {
170
- #{type}* set;
172
+ #{type_ref} set;
171
173
  int bucket_index;
172
174
  #{@list.it} it;
173
175
  };
174
176
  $
175
177
  end
176
178
 
177
- def write_exported_declarations(stream, declare, define)
179
+ def write_intf_decls(stream, declare, define)
180
+ super
178
181
  stream << %$
179
- #{declare} void #{ctor}(#{type}*);
180
- #{declare} void #{dtor}(#{type}*);
181
- #{declare} void #{copy}(#{type}*, #{type}*);
182
- #{declare} int #{equal}(#{type}*, #{type}*);
183
- #{declare} size_t #{identify}(#{type}*);
184
- #{declare} void #{purge}(#{type}*);
185
- #{declare} int #{contains}(#{type}*, #{element.type});
186
- #{declare} #{element.type} #{get}(#{type}*, #{element.type});
187
- #{declare} size_t #{size}(#{type}*);
182
+ #{declare} #{ctor.declaration};
183
+ #{declare} #{dtor.declaration};
184
+ #{declare} #{copy.declaration};
185
+ #{declare} #{equal.declaration};
186
+ #{declare} #{identify.declaration};
187
+ #{declare} void #{purge}(#{type_ref});
188
+ #{declare} int #{contains}(#{type_ref}, #{element.type});
189
+ #{declare} #{element.type} #{get}(#{type_ref}, #{element.type});
190
+ #{declare} size_t #{size}(#{type_ref});
188
191
  #define #{empty}(self) (#{size}(self) == 0)
189
- #{declare} int #{put}(#{type}*, #{element.type});
190
- #{declare} int #{replace}(#{type}*, #{element.type});
191
- #{declare} int #{remove}(#{type}*, #{element.type});
192
- #{declare} void #{exclude}(#{type}*, #{type}*);
193
- #{declare} void #{retain}(#{type}*, #{type}*);
194
- #{declare} void #{include}(#{type}*, #{type}*);
195
- #{declare} void #{invert}(#{type}*, #{type}*);
196
- #{declare} void #{itCtor}(#{it}*, #{type}*);
197
- #{declare} int #{itMove}(#{it}*);
198
- #{declare} #{element.type} #{itGet}(#{it}*);
192
+ #{declare} int #{put}(#{type_ref}, #{element.type});
193
+ #{declare} int #{replace}(#{type_ref}, #{element.type});
194
+ #{declare} int #{remove}(#{type_ref}, #{element.type});
195
+ #{declare} void #{exclude}(#{type_ref}, #{type_ref});
196
+ #{declare} void #{retain}(#{type_ref}, #{type_ref});
197
+ #{declare} void #{include}(#{type_ref}, #{type_ref});
198
+ #{declare} void #{invert}(#{type_ref}, #{type_ref});
199
+ #{declare} void #{itCtor}(#{it_ref}, #{type_ref});
200
+ #{declare} int #{itMove}(#{it_ref});
201
+ #{declare} #{element.type} #{itGet}(#{it_ref});
199
202
  $
200
203
  end
201
204
 
202
- def write_implementations(stream, define)
203
- @list.write_exported_declarations(stream, static, inline)
204
- @list.write_implementations(stream, static)
205
+ def write_impls(stream, define)
206
+ @list.write_intf_decls(stream, static, inline)
207
+ @list.write_impls(stream, static)
205
208
  stream << %$
206
- #{define} #{element.type}* #{itGetRef}(#{it}*);
207
- static void #{rehash}(#{type}* self) {
208
- #{@list.type}* buckets;
209
+ #{define} #{element.type_ref} #{itGetRef}(#{it_ref});
210
+ static void #{rehash}(#{type_ref} self) {
211
+ #{@list.type_ref} buckets;
209
212
  size_t index, bucket_count, size, fill;
210
213
  #{assert}(self);
211
214
  #{assert}(self->min_fill > 0);
@@ -230,7 +233,7 @@ class HashSet < Collection
230
233
  bucket_count = self->min_bucket_count;
231
234
  size = 0;
232
235
  }
233
- buckets = (#{@list.type}*)#{malloc}(bucket_count*sizeof(#{@list.type})); #{assert}(buckets);
236
+ buckets = (#{@list.type_ref})#{malloc}(bucket_count*sizeof(#{@list.type})); #{assert}(buckets);
234
237
  for(index = 0; index < bucket_count; ++index) {
235
238
  #{@list.ctor}(&buckets[index]);
236
239
  }
@@ -250,7 +253,17 @@ class HashSet < Collection
250
253
  self->bucket_count = bucket_count;
251
254
  self->size = size;
252
255
  }
253
- #{define} void #{ctor}(#{type}* self) {
256
+ static int #{containsAllOf}(#{type_ref} self, #{type_ref} other) {
257
+ #{it} it;
258
+ #{itCtor}(&it, self);
259
+ while(#{itMove}(&it)) {
260
+ int found = 0;
261
+ if(#{contains}(other, *#{itGetRef}(&it))) found = 1;
262
+ if(!found) return 0;
263
+ }
264
+ return 1;
265
+ }
266
+ #{define} #{ctor.definition} {
254
267
  #{assert}(self);
255
268
  self->min_bucket_count = 16;
256
269
  self->min_fill = 20;
@@ -261,7 +274,7 @@ class HashSet < Collection
261
274
  self->buckets = NULL;
262
275
  #{rehash}(self);
263
276
  }
264
- #{define} void #{dtor}(#{type}* self) {
277
+ #{define} #{dtor.definition} {
265
278
  size_t i;
266
279
  #{assert}(self);
267
280
  for(i = 0; i < self->bucket_count; ++i) {
@@ -269,7 +282,7 @@ class HashSet < Collection
269
282
  }
270
283
  #{free}(self->buckets);
271
284
  }
272
- #{define} void #{copy}(#{type}* dst, #{type}* src) {
285
+ #{define} #{copy.definition} {
273
286
  #{it} it;
274
287
  #{assert}(src);
275
288
  #{assert}(dst);
@@ -277,22 +290,12 @@ class HashSet < Collection
277
290
  #{itCtor}(&it, src);
278
291
  while(#{itMove}(&it)) #{put}(dst, *#{itGetRef}(&it));
279
292
  }
280
- static int #{containsAllOf}(#{type}* self, #{type}* other) {
281
- #{it} it;
282
- #{itCtor}(&it, self);
283
- while(#{itMove}(&it)) {
284
- int found = 0;
285
- if(#{contains}(other, *#{itGetRef}(&it))) found = 1;
286
- if(!found) return 0;
287
- }
288
- return 1;
289
- }
290
- #{define} int #{equal}(#{type}* lt, #{type}* rt) {
293
+ #{define} #{equal.definition} {
291
294
  #{assert}(lt);
292
295
  #{assert}(rt);
293
296
  return #{size}(lt) == #{size}(rt) && #{containsAllOf}(lt, rt) && #{containsAllOf}(rt, lt);
294
297
  }
295
- #{define} size_t #{identify}(#{type}* self) {
298
+ #{define} #{identify.definition} {
296
299
  #{it} it;
297
300
  size_t result = 0;
298
301
  #{assert}(self);
@@ -304,29 +307,29 @@ class HashSet < Collection
304
307
  }
305
308
  return result;
306
309
  }
307
- #{define} void #{purge}(#{type}* self) {
310
+ #{define} void #{purge}(#{type_ref} self) {
308
311
  #{assert}(self);
309
312
  #{dtor}(self);
310
313
  self->buckets = NULL;
311
314
  #{rehash}(self);
312
315
  }
313
- #{define} int #{contains}(#{type}* self, #{element.type} element) {
316
+ #{define} int #{contains}(#{type_ref} self, #{element.type} element) {
314
317
  #{assert}(self);
315
318
  return #{@list.contains}(&self->buckets[#{element.identify("element")} % self->bucket_count], element);
316
319
  }
317
- #{define} #{element.type} #{get}(#{type}* self, #{element.type} element) {
320
+ #{define} #{element.type} #{get}(#{type_ref} self, #{element.type} element) {
318
321
  #{element.type} result;
319
322
  #{assert}(self);
320
323
  #{assert}(#{contains}(self, element));
321
324
  result = #{@list.find}(&self->buckets[#{element.identify("element")} % self->bucket_count], element);
322
325
  return result;
323
326
  }
324
- #{define} size_t #{size}(#{type}* self) {
327
+ #{define} size_t #{size}(#{type_ref} self) {
325
328
  #{assert}(self);
326
329
  return self->size;
327
330
  }
328
- #{define} int #{put}(#{type}* self, #{element.type} element) {
329
- #{@list.type}* bucket;
331
+ #{define} int #{put}(#{type_ref} self, #{element.type} element) {
332
+ #{@list.type_ref} bucket;
330
333
  #{assert}(self);
331
334
  bucket = &self->buckets[#{element.identify("element")} % self->bucket_count];
332
335
  if(!#{@list.contains}(bucket, element)) {
@@ -337,14 +340,14 @@ class HashSet < Collection
337
340
  }
338
341
  return 0;
339
342
  }
340
- #{define} int #{replace}(#{type}* self, #{element.type} element) {
341
- #{@list.type}* bucket;
343
+ #{define} int #{replace}(#{type_ref} self, #{element.type} element) {
344
+ #{@list.type_ref} bucket;
342
345
  #{assert}(self);
343
346
  bucket = &self->buckets[#{element.identify("element")} % self->bucket_count];
344
347
  return #{@list.replace}(bucket, element);
345
348
  }
346
- #{define} int #{remove}(#{type}* self, #{element.type} element) {
347
- #{@list.type}* bucket;
349
+ #{define} int #{remove}(#{type_ref} self, #{element.type} element) {
350
+ #{@list.type_ref} bucket;
348
351
  #{assert}(self);
349
352
  bucket = &self->buckets[#{element.identify("element")} % self->bucket_count];
350
353
  if(#{@list.remove}(bucket, element)) {
@@ -354,21 +357,21 @@ class HashSet < Collection
354
357
  }
355
358
  return 0;
356
359
  }
357
- #{define} void #{exclude}(#{type}* self, #{type}* other) {
360
+ #{define} void #{exclude}(#{type_ref} self, #{type_ref} other) {
358
361
  #{it} it;
359
362
  #{assert}(self);
360
363
  #{assert}(other);
361
364
  #{itCtor}(&it, other);
362
365
  while(#{itMove}(&it)) #{remove}(self, *#{itGetRef}(&it));
363
366
  }
364
- #{define} void #{include}(#{type}* self, #{type}* other) {
367
+ #{define} void #{include}(#{type_ref} self, #{type_ref} other) {
365
368
  #{it} it;
366
369
  #{assert}(self);
367
370
  #{assert}(other);
368
371
  #{itCtor}(&it, other);
369
372
  while(#{itMove}(&it)) #{put}(self, *#{itGetRef}(&it));
370
373
  }
371
- #{define} void #{retain}(#{type}* self, #{type}* other) {
374
+ #{define} void #{retain}(#{type_ref} self, #{type_ref} other) {
372
375
  #{it} it;
373
376
  #{type} set;
374
377
  #{assert}(self);
@@ -382,7 +385,7 @@ class HashSet < Collection
382
385
  #{dtor}(self);
383
386
  *self = set;
384
387
  }
385
- #{define} void #{invert}(#{type}* self, #{type}* other) {
388
+ #{define} void #{invert}(#{type_ref} self, #{type_ref} other) {
386
389
  #{it} it;
387
390
  #{type} set;
388
391
  #{assert}(self);
@@ -401,12 +404,12 @@ class HashSet < Collection
401
404
  #{dtor}(self);
402
405
  *self = set;
403
406
  }
404
- #{define} void #{itCtor}(#{it}* self, #{type}* set) {
407
+ #{define} void #{itCtor}(#{it_ref} self, #{type_ref} set) {
405
408
  #{assert}(self);
406
409
  self->set = set;
407
410
  self->bucket_index = -1;
408
411
  }
409
- #{define} int #{itMove}(#{it}* self) {
412
+ #{define} int #{itMove}(#{it_ref} self) {
410
413
  #{assert}(self);
411
414
  if(self->bucket_index < 0) #{@list.itCtor}(&self->it, &self->set->buckets[self->bucket_index = 0]);
412
415
  if(#{@list.itMove}(&self->it)) return 1;
@@ -416,17 +419,24 @@ class HashSet < Collection
416
419
  }
417
420
  return 0;
418
421
  }
419
- #{define} #{element.type} #{itGet}(#{it}* self) {
422
+ #{define} #{element.type} #{itGet}(#{it_ref} self) {
420
423
  #{assert}(self);
421
424
  return #{@list.itGet}(&self->it);
422
425
  }
423
- #{define} #{element.type}* #{itGetRef}(#{it}* self) {
426
+ #{define} #{element.type_ref} #{itGetRef}(#{it_ref} self) {
424
427
  #{assert}(self);
425
428
  return #{@list.itGetRef}(&self->it);
426
429
  }
427
430
  $
428
431
  end
429
432
 
433
+ private
434
+
435
+ def key_type_check(obj)
436
+ raise "type #{obj.type} (#{obj}) must be hashable" unless obj.hashable?
437
+ element_type_check(obj)
438
+ end
439
+
430
440
  end # HashSet
431
441
 
432
442
 
@@ -154,7 +154,12 @@ WARNING: current position *must* be valid otherwise the behavior is undefined. S
154
154
  =end
155
155
  class List < Collection
156
156
 
157
- def write_exported_types(stream)
157
+ def initialize(*args)
158
+ super
159
+ @capability.subtract [:orderable]
160
+ end
161
+
162
+ def write_intf_types(stream)
158
163
  stream << %$
159
164
  /***
160
165
  **** #{type}<#{element.type}> (#{self.class})
@@ -170,7 +175,7 @@ class List < Collection
170
175
  };
171
176
  struct #{it} {
172
177
  int start;
173
- #{type}* list;
178
+ #{type_ref} list;
174
179
  #{node}* this_node;
175
180
  };
176
181
  struct #{node} {
@@ -180,42 +185,43 @@ class List < Collection
180
185
  $
181
186
  end
182
187
 
183
- def write_exported_declarations(stream, declare, define)
188
+ def write_intf_decls(stream, declare, define)
189
+ super
184
190
  stream << %$
185
- #{declare} void #{ctor}(#{type}*);
186
- #{declare} void #{dtor}(#{type}*);
187
- #{declare} void #{copy}(#{type}*, #{type}*);
188
- #{declare} int #{equal}(#{type}*, #{type}*);
189
- #{declare} size_t #{identify}(#{type}*);
190
- #{declare} void #{purge}(#{type}*);
191
- #{declare} #{element.type} #{peek}(#{type}*);
192
- #{declare} #{element.type} #{pop}(#{type}*);
193
- #{declare} void #{push}(#{type}*, #{element.type});
194
- #{declare} int #{contains}(#{type}*, #{element.type});
195
- #{declare} #{element.type} #{find}(#{type}*, #{element.type});
191
+ #{declare} #{ctor.declaration};
192
+ #{declare} #{dtor.declaration};
193
+ #{declare} #{copy.declaration};
194
+ #{declare} #{equal.declaration};
195
+ #{declare} #{identify.declaration};
196
+ #{declare} void #{purge}(#{type_ref});
197
+ #{declare} #{element.type} #{peek}(#{type_ref});
198
+ #{declare} #{element.type} #{pop}(#{type_ref});
199
+ #{declare} void #{push}(#{type_ref}, #{element.type});
200
+ #{declare} int #{contains}(#{type_ref}, #{element.type});
201
+ #{declare} #{element.type} #{find}(#{type_ref}, #{element.type});
196
202
  #define #{replace}(self, with) #{replaceEx}(self, with, 1)
197
203
  #define #{replaceAll}(self, with) #{replaceEx}(self, with, -1)
198
- #{declare} int #{replaceEx}(#{type}*, #{element.type}, int);
204
+ #{declare} int #{replaceEx}(#{type_ref}, #{element.type}, int);
199
205
  #define #{remove}(self, what) #{removeEx}(self, what, 1)
200
206
  #define #{removeAll}(self, what) #{removeEx}(self, what, -1)
201
- #{declare} int #{removeEx}(#{type}*, #{element.type}, int);
202
- #{declare} size_t #{size}(#{type}*);
207
+ #{declare} int #{removeEx}(#{type_ref}, #{element.type}, int);
208
+ #{declare} size_t #{size}(#{type_ref});
203
209
  #define #{empty}(self) (#{size}(self) == 0)
204
- #{declare} void #{itCtor}(#{it}*, #{type}*);
205
- #{declare} int #{itMove}(#{it}*);
206
- #{declare} #{element.type} #{itGet}(#{it}*);
210
+ #{declare} void #{itCtor}(#{it_ref}, #{type_ref});
211
+ #{declare} int #{itMove}(#{it_ref});
212
+ #{declare} #{element.type} #{itGet}(#{it_ref});
207
213
  $
208
214
  end
209
215
 
210
- def write_implementations(stream, define)
216
+ def write_impls(stream, define)
211
217
  stream << %$
212
- #{define} #{element.type}* #{itGetRef}(#{it}*);
213
- #{define} void #{ctor}(#{type}* self) {
218
+ #{define} #{element.type_ref} #{itGetRef}(#{it_ref});
219
+ #{define} #{ctor.definition} {
214
220
  #{assert}(self);
215
221
  self->head_node = NULL;
216
222
  self->node_count = 0;
217
223
  }
218
- #{define} void #{dtor}(#{type}* self) {
224
+ #{define} #{dtor.definition} {
219
225
  #{node}* node;
220
226
  #{assert}(self);
221
227
  node = self->head_node;
@@ -226,7 +232,7 @@ class List < Collection
226
232
  #{free}(this_node);
227
233
  }
228
234
  }
229
- #{define} void #{copy}(#{type}* dst, #{type}* src) {
235
+ #{define} #{copy.definition} {
230
236
  #{it} it;
231
237
  #{assert}(src);
232
238
  #{assert}(dst);
@@ -236,14 +242,15 @@ class List < Collection
236
242
  #{push}(dst, *#{itGetRef}(&it));
237
243
  }
238
244
  }
239
- #{define} int #{equal}(#{type}* lt, #{type}* rt) {
245
+ #{define} #{equal.definition} {
240
246
  if(#{size}(lt) == #{size}(rt)) {
241
247
  #{it} lit, rit;
242
248
  #{itCtor}(&lit, lt);
243
249
  #{itCtor}(&rit, rt);
244
250
  while(#{itMove}(&lit) && #{itMove}(&rit)) {
245
251
  int equal;
246
- #{element.type} *le, *re;
252
+ #{element.type_ref} le;
253
+ #{element.type_ref} re;
247
254
  le = #{itGetRef}(&lit);
248
255
  re = #{itGetRef}(&rit);
249
256
  equal = #{element.equal("*le", "*re")};
@@ -253,7 +260,7 @@ class List < Collection
253
260
  } else
254
261
  return 0;
255
262
  }
256
- #{define} size_t #{identify}(#{type}* self) {
263
+ #{define} #{identify.definition} {
257
264
  #{node}* node;
258
265
  size_t result = 0;
259
266
  #{assert}(self);
@@ -263,18 +270,18 @@ class List < Collection
263
270
  }
264
271
  return result;
265
272
  }
266
- #{define} void #{purge}(#{type}* self) {
273
+ #{define} void #{purge}(#{type_ref} self) {
267
274
  #{dtor}(self);
268
275
  #{ctor}(self);
269
276
  }
270
- #{define} #{element.type} #{peek}(#{type}* self) {
277
+ #{define} #{element.type} #{peek}(#{type_ref} self) {
271
278
  #{element.type} result;
272
279
  #{assert}(self);
273
280
  #{assert}(!#{empty}(self));
274
281
  #{element.copy("result", "self->head_node->element")};
275
282
  return result;
276
283
  }
277
- #{define} #{element.type} #{pop}(#{type}* self) {
284
+ #{define} #{element.type} #{pop}(#{type_ref} self) {
278
285
  #{node}* node;
279
286
  #{element.type} result;
280
287
  #{assert}(self);
@@ -286,7 +293,7 @@ class List < Collection
286
293
  #{free}(node);
287
294
  return result;
288
295
  }
289
- #{define} void #{push}(#{type}* self, #{element.type} element) {
296
+ #{define} void #{push}(#{type_ref} self, #{element.type} element) {
290
297
  #{node}* node;
291
298
  #{assert}(self);
292
299
  node = (#{node}*)#{malloc}(sizeof(#{node})); #{assert}(node);
@@ -295,7 +302,7 @@ class List < Collection
295
302
  self->head_node = node;
296
303
  ++self->node_count;
297
304
  }
298
- #{define} int #{contains}(#{type}* self, #{element.type} what) {
305
+ #{define} int #{contains}(#{type_ref} self, #{element.type} what) {
299
306
  #{node}* node;
300
307
  int found = 0;
301
308
  #{assert}(self);
@@ -309,7 +316,7 @@ class List < Collection
309
316
  }
310
317
  return found;
311
318
  }
312
- #{define} #{element.type} #{find}(#{type}* self, #{element.type} what) {
319
+ #{define} #{element.type} #{find}(#{type_ref} self, #{element.type} what) {
313
320
  #{node}* node;
314
321
  #{assert}(self);
315
322
  #{assert}(#{contains}(self, what));
@@ -324,7 +331,7 @@ class List < Collection
324
331
  }
325
332
  #{abort}();
326
333
  }
327
- #{define} int #{replaceEx}(#{type}* self, #{element.type} with, int count) {
334
+ #{define} int #{replaceEx}(#{type_ref} self, #{element.type} with, int count) {
328
335
  #{node}* node;
329
336
  int replaced = 0;
330
337
  #{assert}(self);
@@ -341,7 +348,7 @@ class List < Collection
341
348
  }
342
349
  return replaced;
343
350
  }
344
- #{define} int #{removeEx}(#{type}* self, #{element.type} what, int count) {
351
+ #{define} int #{removeEx}(#{type_ref} self, #{element.type} what, int count) {
345
352
  #{node} *node, *prev_node;
346
353
  int removed = 0;
347
354
  #{assert}(self);
@@ -369,17 +376,17 @@ class List < Collection
369
376
  }
370
377
  return removed;
371
378
  }
372
- #{define} size_t #{size}(#{type}* self) {
379
+ #{define} size_t #{size}(#{type_ref} self) {
373
380
  #{assert}(self);
374
381
  return self->node_count;
375
382
  }
376
- #{define} void #{itCtor}(#{it}* self, #{type}* list) {
383
+ #{define} void #{itCtor}(#{it_ref} self, #{type_ref} list) {
377
384
  #{assert}(self);
378
385
  #{assert}(list);
379
386
  self->start = 1;
380
387
  self->list = list;
381
388
  }
382
- #{define} int #{itMove}(#{it}* self) {
389
+ #{define} int #{itMove}(#{it_ref} self) {
383
390
  #{assert}(self);
384
391
  if(self->start) {
385
392
  self->this_node = self->list->head_node;
@@ -389,14 +396,14 @@ class List < Collection
389
396
  }
390
397
  return self->this_node != NULL;
391
398
  }
392
- #{define} #{element.type} #{itGet}(#{it}* self) {
399
+ #{define} #{element.type} #{itGet}(#{it_ref} self) {
393
400
  #{element.type} result;
394
401
  #{assert}(self);
395
402
  #{assert}(self->this_node);
396
403
  #{element.copy("result", "self->this_node->element")};
397
404
  return result;
398
405
  }
399
- #{define} #{element.type}* #{itGetRef}(#{it}* self) {
406
+ #{define} #{element.type_ref} #{itGetRef}(#{it_ref} self) {
400
407
  #{assert}(self);
401
408
  #{assert}(self->this_node);
402
409
  return &self->this_node->element;