<commit_before>###
# [set]

.namespace [ "Tcl" ]

.sub "&set"
  .local pmc argv 
  argv = foldup

  .local int len, argc  
  argc = argv

  .local pmc retval
  .local int return_type
  return_type = TCL_OK
 
  if argc == 0 goto error
  if argc > 2 goto error

  .local string name
  name = argv[0] 
  if argc == 2 goto setting
  if argc == 1 goto getting

getting:
  .local pmc read
  read = find_global "_Tcl", "__read"
  .return read(name)

setting:
  .local pmc set
  set = find_global "_Tcl", "__set"

  .local pmc value
  value = argv[1]
  .return set(name,value)

error:
  return_type = TCL_ERROR 
  retval = "wrong # args: should be \"set varName ?newValue?\""
  .return(return_type,retval)

catch:
  goto resume
.end<commit_msg>pass 4 more tests in tcl test suite for [set]<commit_after>###
# [set]

.namespace [ "Tcl" ]

.sub "&set"
  .local pmc argv 
  argv = foldup

  .local int len, argc  
  argc = argv

  .local pmc retval
  .local int return_type
  return_type = TCL_OK
 
  if argc == 0 goto error
  if argc > 2 goto error

  .local string name
  name = argv[0] 
  if argc == 2 goto setting
  if argc == 1 goto getting

getting:
  .local pmc read
  read = find_global "_Tcl", "__read"
  .return read(name)

setting:
  .local pmc set
  set = find_global "_Tcl", "__set"

  .local pmc value
  value = argv[1]
  .return set(name,value)

error:
  return_type = TCL_ERROR 
  retval = new String
  retval = "wrong # args: should be \"set varName ?newValue?\""
  .return(return_type,retval)

catch:
  goto resume
.end
{'fraction_non_alphanumeric': 0.1107470511140236, 'fraction_numerical': 0.00851900393184797, 'mean_word_length': 2.856060606060606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5917540', 'n_tokens_mistral': 589, 'n_tokens_neox': 565, 'n_words': 193}