<commit_before>//
//  Once.swift
//  Eki
//
//  Created by <NAME> on 20/10/2014.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Foundation

/**
@abstract
A token to be initilized and stored for use with once().
*/
public final class Token {
    internal var dispatchToken = dispatch_once_t(0)
}

/**
@abstract
Convenient method for dispatch_once
*/
public func  once(token:Token, block:() -> Void) {
    dispatch_once(&token.dispatchToken,block)
}<commit_msg>Update: Rename Token class to OnceToken to avoid confusion<commit_after>//
//  Once.swift
//  Eki
//
//  Created by <NAME> on 20/10/2014.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Foundation

/**
A token to be initilized and stored for use with once().
*/
public final class OnceToken {
    internal var dispatchToken = dispatch_once_t(0)
}

/**
Execute a block once and only once.
*/
public func once(token:OnceToken, block:() -> Void) {
    dispatch_once(&token.dispatchToken,block)
}
{'fraction_non_alphanumeric': 0.13238289205702647, 'fraction_numerical': 0.026476578411405296, 'mean_word_length': 3.4279279279279278, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1146086', 'n_tokens_mistral': 337, 'n_tokens_neox': 309, 'n_words': 105}