Showing the changes to src/core/ulib_std.cpp (1 of 9 files). Show all
Unified · Split
| @@ -395,8 +395,8 @@ DLL_QUERY libstd_query( Chuck_DL_Query * QUERY ) · 394 unmodified lines | ||
| 395 | 395 | #ifndef __DISABLE_PROMPTER__ |
| 396 | 396 | // begin class (Skot) |
| 397 | 397 | if( !type_engine_import_class_begin( env, "ConsoleInput", "Event", |
| 398 | − env->global(), Skot_ctor, | |
| 399 | − Skot_dtor ) ) | |
| 398 | + env->global(), Skot_ctor, Skot_dtor, | |
| 399 | + "(Terminal only) a utility for prompting user input on the command line." ) ) | |
| 400 | 400 | return FALSE; |
| 401 | 401 | |
| 402 | 402 | // add member variable |
| @@ -405,25 +405,35 @@ DLL_QUERY libstd_query( Chuck_DL_Query * QUERY ) · 2 unmodified lines | ||
| 405 | 405 | |
| 406 | 406 | // add prompt() |
| 407 | 407 | func = make_new_mfun( "Event", "prompt", Skot_prompt ); |
| 408 | + func->doc = "Return an Event to wait on."; | |
| 408 | 409 | if( !type_engine_import_mfun( env, func ) ) goto error; |
| 409 | 410 | |
| 410 | 411 | // add prompt() |
| 411 | 412 | func = make_new_mfun( "Event", "prompt", Skot_prompt2 ); |
| 412 | 413 | func->add_arg( "string", "what" ); |
| 414 | + func->doc = "Print a prompt text and return an Event to wait on."; | |
| 413 | 415 | if( !type_engine_import_mfun( env, func ) ) goto error; |
| 414 | 416 | |
| 415 | − // add ready() | |
| 417 | + // add more() | |
| 416 | 418 | func = make_new_mfun( "int", "more", Skot_more ); |
| 419 | + func->doc = "Return whether there is more input to read."; | |
| 417 | 420 | if( !type_engine_import_mfun( env, func ) ) goto error; |
| 418 | 421 | |
| 419 | 422 | // add getString() |
| 420 | 423 | func = make_new_mfun( "string", "getLine", Skot_getLine ); |
| 424 | + func->doc = "Return the next line of input as a string."; | |
| 421 | 425 | if( !type_engine_import_mfun( env, func ) ) goto error; |
| 422 | 426 | |
| 423 | 427 | // add can_wait() |
| 424 | 428 | func = make_new_mfun( "int", "can_wait", Skot_can_wait ); |
| 429 | + func->doc = "(internal) used by virtual machine for synthronization."; | |
| 425 | 430 | if( !type_engine_import_mfun( env, func ) ) goto error; |
| 426 | 431 | |
| 432 | + // add examples | |
| 433 | + if( !type_engine_import_add_ex( env, "string/readline.ck" ) ) goto error; | |
| 434 | + if( !type_engine_import_add_ex( env, "ai/word2vec/word2vec-prompt.ck" ) ) goto error; | |
| 435 | + if( !type_engine_import_add_ex( env, "ai/word2vec/poem-ungenerate.ck" ) ) goto error; | |
| 436 | + | |
| 427 | 437 | // end class |
| 428 | 438 | type_engine_import_class_end( env ); |
| 429 | 439 | #endif // __DISABLE_PROMPTER__ |