Proposal for IrcII scripting extention -- 

New variable operator ->

Which references properties functions when the variable is 
a string of format #objectclass_objectid where object class
is an internal or external class of information, and ID is 
a unique ID generated by the object creation function.


Log -
<mikh> otherways if var contains "#button_834782"
<mikh> ie just id
<mikh> I'll have to do
<mikh> $setbuttontext()
<mikh> I think adding -> is a nice idea
<[NuKe]> yeah it is 
<mikh> for example if var== window refnum
<mikh> then window commands may be accessed like
<[NuKe]> nevermind.. that \ is internal?
<mikh> $window->logfile(status.log)
<mikh> $window->new()->setwindowpos(lalala)->font(lalala)
<mikh> nah its just to stop variable parsing
<[NuKe]> that would be very useful
<mikh> after the dollar sign it should stop somewhere                         
<[NuKe]> yeah I know but that is all done internally right... unknown to the
scripter
<mikh> $varnamewhereitends
<mikh> basicly rule is
<mikh> when we paring $var
ùíù SignOff _aw: #OpenChat (no windows left)
<mikh> if after the var instead of dot or [ or (
<mikh> we have ->
<mikh> then we doing following
<[NuKe]> right
<mikh> generating code to take value of var,
<[NuKe]> I understand all that... it's the \'s you were refereing to that had
           me confused ;)
<mikh> and calling "object_property(value_of_var, rest of params)             
<mikh> now value_of_var must be something like
<mikh> #objecttype_id                                
<mikh> #window_<refnum> 
<mikh> #server_<servernum>                                                    
<[NuKe]> right   
<mikh> #channel_<server>#channel_name                                         
<mikh> #pluging_registered_type_<plugin_generated_id>"                        
<mikh> there should be a list of struct ObjectClass {Name, (*handler)()}      
<mikh> we getting somewhere [NuKe]                                            
<mikh> if imlemented this is gonna be a next thing since sliced bread         
<[NuKe]> shouldn't be hard to implement either                                
<mikh> should be a standard new operator                                      
<[NuKe]> except for a couple handlers                                         
<mikh>  /new Window.... /new classname                                        
<mikh> or function                                                            
<mikh> @id = new(classname createparams)                                      
<mikh> good thing id is just a string                                         
<mikh> consisted of classname_class_generated_id                              
<mikh> class can just sequentially name created objects                       
<mikh> or if it mallocs objects                                               
<[NuKe]> maybe we'll need something like $registerclass()                       
<[NuKe]> for scriptable class functions?                                        
<[NuKe]> or                                                                     
ùíù BitchX: Unknown command "registerclass"                                     
<[NuKe]> /registerclass "classname" { }                                         
<[NuKe]> ?                                                                      
<[NuKe]> er                                                                     
<[NuKe]> maybe                                                                  
<[NuKe]> /registerclass "classname"                                             
<[NuKe]> and then                                                               
<[NuKe]> /registerfunction "classname" "functionname" { }                       
<[NuKe]> then                                                                   
ð [NuKe] pokes mikg                                                             
ð [NuKe] pokes mikh                                                             
<[NuKe]> :)                                                                     
<mikh> hmm yea                                                                  
<mikh> why not                                                                  
<mikh> class classname {                                                        
<[NuKe]> blah                                                                   
<mikh>     alias setprop { }                                                    
<mikh>   alias getprop {}                                                       
<mikh> }                                                                        
<[NuKe]> yeah                                                                   
<mikh> class test {                                                             
<mikh> err                                                                      
<mikh> why not make it simple                                                   
<[NuKe]> ok                                                                     
<mikh> skip class test part                                                     
<mikh> alias new.test {                                                         
<mikh>   @class.test.id++                                                       
<mikh>   purge class.test[$class.test.id]                                       
<mikh>  @function_return = class.test.id                                        
<mikh> }                                                                        
<mikh> alias set_something.test {                                               
<mikh>   @class.test[$encode($0)][$1] = [$2-]                                   
<mikh> }                                                                        
<mikh> now if you do $test = new(test)                                          
<mikh> if it can't find internal class it will try to call new.<classname>      
<mikh> which will return 1 (id++ part)                                          
<mikh> then                                                                     
<mikh> err                                                                      
<mikh> it supposed to return "#test_1"                                          
<[NuKe]> right                                                                  
<mikh> then when you dp $test->set_something(bleah)                             
<mikh> it will call .setsomething.test with param "1 bleah" (from #test_1 and a
           param)                                                                
<[NuKe]> right                                                                  
<mikh> whoa                                                                     
<mikh> this looks better and better                                             
ð mikh/#openchat pats himself on the head                                       
<mikh> you are one smart fella                                                  
<mikh> alias server {@function_return = [#server_$0]}                        
<mikh> $server($lastserver())->nick(moo)                                     
<mikh> heh can make shortcats in #classname_id for internal most used things
           like channels                                                      
<mikh> $C->send()                                                            
<[NuKe]> hehe                                                                
<[NuKe]> sweet :)                                                            
<mikh> err #channel will be indistingushable from #classname                 
<[NuKe]> hm                                                                  
<mikh> lets use "<classname>id"                                              
<mikh> it will be returned by new()   
<mikh> when we have $var->something()                 
<mikh> part before -> should expand to such string    
<mikh> which we gonna parse to find needed handler    
<mikh> I gonna do test thingy right after I do menus  
<mikh> next week                                      
<mikh> $window()->query($1)                           
<mikh> syntaxicly it rules...                                                  
<[NuKe]> :)                                                                    
<mikh> alias window if ([$*] == [] {return <window>_$winnum()}{return
                    <window>_$*}          
<mikh> actually even can write more complecated alias so $window(#channelname)
           is possible                                                          
<mikh> all is needed that it will return a string in format <window>_window_ref
<[NuKe]> yep                                                                   
<mikh> $window(#openchat)->setwindowpos()  
<mikh> beauty                              
<[NuKe]> :)                                
<[NuKe]> that is very nice                 
