<commit_before>"   Test for script objects.

    Author: <NAME>
    Date: 2003 Aug 6 
"

| object method source engine |

    Environment includeFramework:'StepTalk'.

" Create a script object and set it's environment " 
    object := STScriptObject scriptObject.
    object setEnvironment:Environment.
    
" This is the source of new method "
    source := 'sayHi Transcript showLine: \'Hi.\'. ^self'.

" Get the proper engine "
    engine := STEngine engineForLanguageWithName:'Smalltalk'.

" Create method "
    method := engine methodFromSource:source 
                          forReceiver:object
                        inEnvironment:Environment.

" Add the method to the object "
    object addMethod:method.

" Sent it! "
    object sayHi.
    
    <commit_msg>updated example<commit_after>"   Test for script objects.

    Author: <NAME>
    Date: 2003 Aug 6 
"

| object method source engine |

    Environment includeFramework:'StepTalk'.

" Create a script object and set it's environment " 
    object := STScriptObject scriptObject.
    object setEnvironment:Environment.
    
" Get the proper engine "
    engine := STEngine engineForLanguageWithName:'Smalltalk'.

" This is the source of new method "
    source := 'sayHi Transcript showLine: \'Hi.\'. ^self'.

" Create method "
    method := engine methodFromSource:source 
                          forReceiver:object
                        inEnvironment:Environment.

" Add the method to the object "
    object addMethod:method.

" Add another method with an argument "
    source := 'sayHiTo:someone Transcript showLine: (\'Hi \', someone). ^self'.
    method := engine methodFromSource:source 
                          forReceiver:object
                        inEnvironment:Environment.
    object addMethod:method.


" Sent it! "
    object sayHi.
    object sayHiTo:'GNUstep'.
    
    
{'fraction_non_alphanumeric': 0.0836461126005362, 'fraction_numerical': 0.005361930294906166, 'mean_word_length': 2.4491682070240297, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7616312', 'n_tokens_mistral': 510, 'n_tokens_neox': 473, 'n_words': 161}