archive-org.com » ORG » I » IOKE.ORG

Total: 746

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • User talk:Olabini2 - IokeWiki
    Retrieved from http ioke org internal wiki index php User talk Olabini2 Views User page Discussion View source History Personal tools 192 168 0 2 Talk for this IP Log in News About Ioke Guide Download Project page CI Reference Resources Wiki Wiki Main Page Recent changes Search Toolbox What links here Related changes User contributions Logs Special pages Printable version Permanent link This page was last modified on 10

    Original URL path: https://ioke.org/wiki/index.php?title=User_talk:Olabini2&diff=prev&oldid=483 (2016-02-13)
    Open archived version from archive


  • User talk:Olabini2 - IokeWiki
    tools 192 168 0 2 Talk for this IP Log in News About Ioke Guide Download Project page CI Reference Resources Wiki Wiki Main Page Recent changes Search Toolbox What links here Related changes User contributions Logs Special pages Printable

    Original URL path: https://ioke.org/wiki/index.php/User_talk:Olabini2 (2016-02-13)
    Open archived version from archive

  • Revision history of "User:Olabini2" - IokeWiki
    500 cur last 01 15 10 March 2011 Admin Talk contribs m empty Creating user page with biography of new user Latest Earliest View newer 50 older 50 20 50 100 250 500 Retrieved from http ioke org internal wiki index php User Olabini2 Views User page Discussion View source History Personal tools 192 168 0 2 Talk for this IP Log in News About Ioke Guide Download Project page

    Original URL path: https://ioke.org/wiki/index.php?title=User:Olabini2&action=history (2016-02-13)
    Open archived version from archive

  • User:Olabini2 - IokeWiki
    Newer edit Current revision Retrieved from http ioke org internal wiki index php User Olabini2 Views User page Discussion View source History Personal tools 192 168 0 2 Talk for this IP Log in News About Ioke Guide Download Project page CI Reference Resources Wiki Wiki Main Page Recent changes Search Toolbox What links here Related changes User contributions Logs Special pages Printable version Permanent link This page was last

    Original URL path: https://ioke.org/wiki/index.php?title=User:Olabini2&diff=prev&oldid=482 (2016-02-13)
    Open archived version from archive

  • User:Olabini2 - IokeWiki
    192 168 0 2 Talk for this IP Log in News About Ioke Guide Download Project page CI Reference Resources Wiki Wiki Main Page Recent changes Search Toolbox What links here Related changes User contributions Logs Special pages Printable version

    Original URL path: https://ioke.org/wiki/index.php/User:Olabini2 (2016-02-13)
    Open archived version from archive

  • Guide:Code - IokeWiki
    42 2 3 4 foo blarg 42 2 3 4 foo quux 42 2 lt source gt foo quux 42 2 source To give a keyword argument you just write it exactly like you define keyword arugments a name followed by a colon To give a keyword argument you just write it exactly like you define keyword arugments a name followed by a colon Sometimes it can be useful to be able to take a list of values and give them as positional arguments The same can be useful to do with a dict of names You can do that using splatting This is done by preceding a list or a dict with an asterisk This will result in the method getting the values inside of it as if the arguments were given directly You can splat several things to the same invocation Sometimes it can be useful to be able to take a list of values and give them as positional arguments The same can be useful to do with a dict of names You can do that using splatting This is done by preceding a list or a dict with an asterisk This will result in the method getting the values inside of it as if the arguments were given directly You can splat several things to the same invocation lt source lang quot ioke quot gt dc foo 42 bar 13 source lang ioke dc foo 42 bar 13 ls 1 2 3 4 ls 1 2 3 4 ls2 42 43 44 ls2 42 43 44 foo ls2 111 dc ls foo ls2 111 dc ls the same as the same as foo 42 43 44 111 foo 42 bar 13 1 2 3 4 lt source gt foo 42 43 44 111 foo 42 bar 13 1 2 3 4 source If you try to splat something that can t be splatted a condition will be signalled If you try to splat something that can t be splatted a condition will be signalled Macros Macros The main difference between a macro and a method in Ioke is that the arguments to a macro are not evaluated before they are sent to the macro That means you have to use macros to send raw message chains in an invocation In most languages this kind of feature is generally called call by name When a macro gets called it will get access to a cell called amp quot call amp quot which is a mimic of the kind Call This gives access to information about the call and makes it possible to evaluate the code sent as arguments check how many arguments are supplied and so on The main difference between a macro and a method in Ioke is that the arguments to a macro are not evaluated before they are sent to the macro That means you have to use macros to send raw message chains in an invocation In most languages this kind of feature is generally called call by name When a macro gets called it will get access to a cell called quot call quot which is a mimic of the kind Call This gives access to information about the call and makes it possible to evaluate the code sent as arguments check how many arguments are supplied and so on A macro is created using the amp quot macro amp quot cell on DefaultBehavior This will return a mimic of DefaultMacro Since macros can t define arguments it s a bit easier to describe than methods but the things that can be done with macros are also a bit more interesting than what can be achieved with methods One important thing to keep in mind is that most macros can not receive splatted arguments In most cases keyword arguments aren t available either but they could be faked if needed Macros should generally be used to implement control structures and things that need to manipulate code in different ways A macro is created using the quot macro quot cell on DefaultBehavior This will return a mimic of DefaultMacro Since macros can t define arguments it s a bit easier to describe than methods but the things that can be done with macros are also a bit more interesting than what can be achieved with methods One important thing to keep in mind is that most macros can not receive splatted arguments In most cases keyword arguments aren t available either but they could be faked if needed Macros should generally be used to implement control structures and things that need to manipulate code in different ways Just like a method a macro gets evaluated on a specific receiver It also gets the same kind of method activation context but the contents of it is a bit different Specifically the context for a macro contains cells named amp quot self amp quot amp quot amp quot amp quot currentMessage amp quot amp quot surroundingContext amp quot and amp quot call amp quot It s the amp quot call amp quot cell that is most important It is a mimic of Call and Call defines several important methods for manipulating the call environment These are Just like a method a macro gets evaluated on a specific receiver It also gets the same kind of method activation context but the contents of it is a bit different Specifically the context for a macro contains cells named quot self quot quot quot quot currentMessage quot quot surroundingContext quot and quot call quot It s the quot call quot cell that is most important It is a mimic of Call and Call defines several important methods for manipulating the call environment These are arguments arguments Returns the ground in which the call was initiated This is necessary to evaluate arguments in their own environment Returns the ground in which the call was initiated This is necessary to evaluate arguments in their own environment message message The currently executing message This is the same as the amp quot currentMessage amp quot cell in the macro activation context The currently executing message This is the same as the quot currentMessage quot cell in the macro activation context evaluatedArguments evaluatedArguments Returns a list containing all arguments evaluated according to the regular rules but not handling splatting or keywords Returns a list containing all arguments evaluated according to the regular rules but not handling splatting or keywords These methods are a bit hard to understand so I ll take some examples from the implementation of Ioke and show how macros are used here These methods are a bit hard to understand so I ll take some examples from the implementation of Ioke and show how macros are used here lt source lang quot ioke quot gt Mixins Enumerable map macro source lang ioke Mixins Enumerable map macro quot takes one or two arguments if one argument is given takes one or two arguments if one argument is given it will be evaluated as a message chain on each element it will be evaluated as a message chain on each element in the enumerable and then the result will be collected in the enumerable and then the result will be collected code it s important to notice that the one argument code it s important to notice that the one argument form will establish no context while the two argument form form will establish no context while the two argument form establishes a new lexical closure quot establishes a new lexical closure len call arguments length len call arguments length if len 1 if len 1 code call arguments first code call arguments first self each n result lt lt code evaluateOn call ground cell n self each n result code evaluateOn call ground cell n code LexicalBlock createFrom call arguments call ground code LexicalBlock createFrom call arguments call ground self each n result lt lt code call cell n self each n result code call cell n result lt source gt result source The code above implements map one of the methods from Enumerable The map method allows one collection to be mapped in a predefined way into something else It can take either one or two arguments If one argument is given that is a message chain to apply and then collect the results If two arguments are given the first is the argument name to use and the second is the code to execute for each entry The code above implements map one of the methods from Enumerable The map method allows one collection to be mapped in a predefined way into something else It can take either one or two arguments If one argument is given that is a message chain to apply and then collect the results If two arguments are given the first is the argument name to use and the second is the code to execute for each entry The first step is to figure out how many arguments have been given This is done by checking the length of the amp quot call arguments amp quot cell If we have a length of one we know that the first argument is a piece of code to apply so we assign that argument to a cell called amp quot code amp quot Now amp quot code amp quot will be a mimic of Message and Message has a method called amp quot evaluateOn amp quot that can be used to fully evaluate a message chain And that s exactly what we do for each element in the collection we are in The result of evaluateOn is added to the result list We use amp quot call ground amp quot to get the correct ground for the code to be evaluated in The first step is to figure out how many arguments have been given This is done by checking the length of the quot call arguments quot cell If we have a length of one we know that the first argument is a piece of code to apply so we assign that argument to a cell called quot code quot Now quot code quot will be a mimic of Message and Message has a method called quot evaluateOn quot that can be used to fully evaluate a message chain And that s exactly what we do for each element in the collection we are in The result of evaluateOn is added to the result list We use quot call ground quot to get the correct ground for the code to be evaluated in If we get two arguments it s possible to take a shortcut and generate a lexical block from those arguments and then use that So we call amp quot LexicalBlock createFrom amp quot and send in the arguments and the ground and then call that piece of code once for each element in the collection If we get two arguments it s possible to take a shortcut and generate a lexical block from those arguments and then use that So we call quot LexicalBlock createFrom quot and send in the arguments and the ground and then call that piece of code once for each element in the collection It is a bit tricky to figure out how macros work I recommend looking at the implementations of some of the core Ioke methods macros since these use much of the functionality It is a bit tricky to figure out how macros work I recommend looking at the implementations of some of the core Ioke methods macros since these use much of the functionality A lexical block allows the execution of a piece of code in the lexical context of some other code instead of in a dynamic object scope A lexical block does not have a receiver Instead it just establishes a new lexical context and executes the code in that The exact effect that has on assignments has been Guide Assignment described earlier A lexical block allows the execution of a piece of code in the lexical context of some other code instead of in a dynamic object scope A lexical block does not have a receiver Instead it just establishes a new lexical context and executes the code in that The exact effect that has on assignments has been Guide Assignment described earlier A lexical block can be created using either the amp quot fn amp quot or the amp quot fnx amp quot methods of DefaultBehavior The main difference between the two is that a block created with amp quot fnx amp quot will be activatable while something created with amp quot fn amp quot will not Lexical blocks handle arguments exactly the same way as methods so a lexical block can take optional arguments keyword arguments rest arguments and so on Both amp quot fn amp quot and amp quot fnx amp quot also take optional documentation text A lexical block can be created using either the quot fn quot or the quot fnx quot methods of DefaultBehavior The main difference between the two is that a block created with quot fnx quot will be activatable while something created with quot fn quot will not Lexical blocks handle arguments exactly the same way as methods so a lexical block can take optional arguments keyword arguments rest arguments and so on Both quot fn quot and quot fnx quot also take optional documentation text A block created with the amp quot fn amp quot method can be invoked using the amp quot call amp quot method of the kind http ioke org dok kinds LexicalBlock html lt code gt LexicalBlock lt code gt A block created with the quot fn quot method can be invoked using the quot call quot method of the kind http ioke org dok kinds LexicalBlock html code LexicalBlock code lt source lang quot ioke quot gt source lang ioke x fn z z println x fn z z println x call 42 x call 42 lt source gt source If a block created with the amp quot fn amp quot method takes one or more explicit parameters it can also be activated like a regular method The reason for this is shown in the code snippet below Here the result of invoking the block referred to by amp quot x amp quot is passed to amp quot y amp quot which may be a regular method or even another block If amp quot x amp quot would be fully non activatable amp quot x amp quot would be passed to amp quot y amp quot as is with the argument thrown away In other words that would be dead code However you can still refer to the block as amp quot x amp quot without an invocation to happen If a block created with the quot fn quot method takes one or more explicit parameters it can also be activated like a regular method The reason for this is shown in the code snippet below Here the result of invoking the block referred to by quot x quot is passed to quot y quot which may be a regular method or even another block If quot x quot would be fully non activatable quot x quot would be passed to quot y quot as is with the argument thrown away In other words that would be dead code However you can still refer to the block as quot x quot without an invocation to happen lt source lang quot ioke quot gt source lang ioke x fn z z 42 x fn z z 42 y x 100 activates the block with argument 100 and passes the result to y y x 100 activates the block with argument 100 and passes the result to y x refers to the block without activating it x refers to the block without activating it lt source gt source A block created with the amp quot fnx amp quot method is activatable per se and thus can be activated like a regular method The default is to use amp quot fn amp quot to create inactive blocks though since blocks are generally used to pass pieces of code around A block created with the quot fnx quot method is activatable per se and thus can be activated like a regular method The default is to use quot fn quot to create inactive blocks though since blocks are generally used to pass pieces of code around lt source lang quot ioke quot gt source lang ioke y fnx z z println y fnx z z println y 42 y 42 lt source gt source A lexical block is a regular kind of object that can be assigned to any cell just like other objects Lexical blocks mimic LexicalBlock and blocks don t have names In contrast to methods and macros no extra cells will be added to the activation context for a lexical block A lexical block is a regular kind of object that can be assigned to any cell just like other objects Lexical blocks mimic LexicalBlock and blocks don t have names In contrast to methods and macros no extra cells will be added to the activation context for a lexical block You can also do several kinds of functional composition of blocks Some of these combinations only make sense for predicates while others are more generally applicable They all expect to work with functions that are OK with only taking one argument though In the following examples f and g are general lexical blocks while p and q are predicates You can also do several kinds of functional composition of blocks Some of these combinations only make sense for predicates while others are more generally applicable They all expect to work with functions that are OK with only taking one argument though In the following examples f and g are general lexical blocks while p and q

    Original URL path: https://ioke.org/wiki/index.php?title=Guide:Code&diff=prev&oldid=415 (2016-02-13)
    Open archived version from archive

  • Main Page - IokeWiki
    Construction And Will Be Available Shortly Please Visit Reserve Copy Page NOTOC NOTOC Welcome to the Ioke wiki This wiki is dedicated to everything that has to do with the Ioke programming language Welcome to the Ioke wiki This wiki is dedicated to everything that has to do with the Ioke programming language lt table width quot 100 quot cellpadding quot 10 quot gt table width 100 cellpadding 10 lt tr valign quot top quot gt tr valign top lt td gt td About Ioke About Ioke Ioke A Ioke A Ioke C Ioke C lt td gt td lt td gt td Libraries Libraries Mike Mike TextScanner TextScanner lt td gt td lt td gt td Development process Development process Ioke for Ruby Developers at RailsWayCon Berlin May 26th 2009 Ioke for Ruby Developers at RailsWayCon Berlin May 26th 2009 More info here http it republik de conferences railswaycon More info here http it republik de conferences railswaycon lt td gt td lt tr gt tr lt table gt table Current revision Retrieved from http ioke org internal wiki index php Main Page Views Page Discussion View source History Personal tools 192 168 0 2 Talk for this IP

    Original URL path: https://ioke.org/wiki/index.php?title=Main_Page&diff=prev&oldid=412 (2016-02-13)
    Open archived version from archive

  • Revision history of "User:Olabini" - IokeWiki
    cur last 19 51 26 January 2009 Olabini Talk contribs 834 bytes cur last 18 00 26 January 2009 Olabini Talk contribs 638 bytes New page Ola Bini Ola is the creator of the Ioke language Before Ioke Ola has been involved in several other language implementations JRuby and Jatha being the most prominent ones Ola h Latest Earliest View newer 50 older 50 20 50 100 250 500 Retrieved

    Original URL path: https://ioke.org/wiki/index.php?title=User:Olabini&action=history (2016-02-13)
    Open archived version from archive



  •