Artifact 15707244447f69717d91d75af2ec22670ff3f709
- File
polemy/fresh.d
- 2010-11-24 03:30:56 - part of checkin [20be503cae] on branch trunk - set up referece manual (user: kinaba) [annotate]
1 /** 2 * Authors: k.inaba 3 * License: NYSL 0.9982 http://www.kmonos.net/nysl/ 4 * 5 * Interpreter-wise fresh ID generator. 6 */ 7 module polemy.fresh; 8 import polemy._common; 9 import core.atomic; 10 11 private shared int freshVarId = -1; 12 13 /// Generate one fresh variable name 14 15 string freshVarName() 16 { 17 return text("$", atomicOp!("+=")(freshVarId, 1)); 18 }