<commit_before>import * as _ from "../deps/underscore-1.10.2-esm.js"
import { undef } from "../header.js";
import { define_libfunc, alias_libfunc, define_syntax, define_scmfunc,
         assert_number, assert_integer, assert_real, assert_between, assert_string,
         assert_char, assert_symbol, assert_port, assert_pair, assert_list,
         assert_function, assert_closure, assert_procedure, assert_date, deprecate } from "./infra.js"; 
import Console from "../system/console.js"
import Interpreter  from "../system/interpreter.js"
import { Pair, alist_to_js_obj } from "../system/pair.js"
import Pause from "../system/pause.js"
import { BiwaSymbol, Sym } from "../system/symbol.js"

// To use webscheme_lib, jQuery must be loaded beforehand
const $ = window.jQuery;

define_libfunc("read-line", 0, 1, function(ar){
  var port = ar[0] || Port.current_input;
  assert_port(port);
  return port.get_string();
});

//
// element
//
define_libfunc("element-empty!", 1, 1, function(ar){
  if ($(ar[0]).prop("value")) {
    return $(ar[0]).val("");
  } else {
    return $(ar[0]).empty();
  }
});
alias_libfunc("element-empty!", "element-clear!");
define_libfunc("element-visible?", 1, 1, function(ar){<commit_msg>fix: read-line did not work<commit_after>import * as _ from "../deps/underscore-1.10.2-esm.js"
import { undef } from "../header.js";
import { define_libfunc, alias_libfunc, define_syntax, define_scmfunc,
         assert_number, assert_integer, assert_real, assert_between, assert_string,
         assert_char, assert_symbol, assert_port, assert_pair, assert_list,
         assert_function, assert_closure, assert_procedure, assert_date, deprecate } from "./infra.js"; 
import Console from "../system/console.js"
import Interpreter  from "../system/interpreter.js"
import { Pair, alist_to_js_obj } from "../system/pair.js"
import Pause from "../system/pause.js"
import { Port } from "../system/port.js"
import { BiwaSymbol, Sym } from "../system/symbol.js"

// To use webscheme_lib, jQuery must be loaded beforehand
const $ = window.jQuery;

define_libfunc("read-line", 0, 1, function(ar){
  var port = ar[0] || Port.current_input;
  assert_port(port);
  return port.get_string(str => str);
});

//
// element
//
define_libfunc("element-empty!", 1, 1, function(ar){
  if ($(ar[0]).prop("value")) {
    return $(ar[0]).val("");
  } else {
    return $(ar[0]).empty();
  }
});
alias_libfunc("element-empty!", "element-clear!");
define_libfunc("element-visible?", 1, 1, function(ar){
{'fraction_non_alphanumeric': 0.16887284396309668, 'fraction_numerical': 0.011231448054552748, 'mean_word_length': 4.295116772823779, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2462026', 'n_tokens_mistral': 849, 'n_tokens_neox': 818, 'n_words': 190}