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".
  • Pitfalls - IokeWiki
    Enumerable that code will raise a condition So for example source lang ioke List test method r source raises the condition didn t get enough arguments 1 missing to Condition Error Invocation TooFewArguments This is because in most contexts the syntax is used for list creation but in the context of a List Dict or Enumerable it s used for list lookup instead allowing us to write things like source

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


  • Guide:Code - IokeWiki
    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 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 exacty 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 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

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

  • Guide:Code - IokeWiki
    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 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 is 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

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

  • Guide:Code - IokeWiki
    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 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 is 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 is also a bit more interesting than what can be achieved

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

  • Guide:Control flow - IokeWiki
    be as clear as it could be Comprehensions allow a list set or dict to be created based on a more abstract definition of what should be done The specific parts of a comprehension is generators filters and the mapping The generators are what data to work on the filters chooses more specifically among the generated data and the mapping decides what the output should look like Ioke s Enumerable mimic makes it really easy to use higher order operations to transform and work with collections of data But in some cases the code for doing that might not be as clear as it could be Comprehensions allow a list set or dict to be created based on a more abstract definition of what should be done The specific parts of a comprehension are generators filters and the mapping The generators are what data to work on the filters chooses more specifically among the generated data and the mapping decides what the output should look like The following example does three nested iterations and returns all combinations where the product of the number is larger than 100 The following example does three nested iterations and returns all combinations where the

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

  • Guide:Control flow - IokeWiki
    condition argument to evaluate to false It will stop iterating when the conditional is true for the first time The until loop works the same as the while loop except it expects its condition argument to evaluate to false It will stop iterating when the conditional is true for the first time source lang ioke x 0 source lang ioke x 0 Revision as of 06 22 12 April 2009

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

  • Guide:Control flow - IokeWiki
    control flow operations for iteration The one thing that is missing is the for loop Since the for loop encourages low level stepping and canbe replaced by other kinds of operations I don t see any reason in having it in Ioke In fact the for statement in Ruby is generally considered bad form too And if someone really wants a for loop it s really easy to implement For now I m reserving the name if I would like to add comprehensions at some point Ioke supports most of the expected control flow operations for iteration The one thing that is missing is the for loop Since the for loop encourages low level stepping and can be replaced by other kinds of operations I don t see any reason in having it in Ioke In fact the for statement in Ruby is generally considered bad form too And if someone really wants a for loop it s really easy to implement For now I m reserving the name if I would like to add comprehensions at some point loop loop Revision as of 06 20 12 April 2009 Retrieved from http ioke org internal wiki index php Guide Control

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

  • Guide:Execution Model - IokeWiki
    things defined at the top level will generally be available in most objects Inside of methods and blocks the ground will be different Exactly in what way is defined by the type of code executing The way an Ioke program works is very simple Everything executes based on two things The first is the context or the ground and the second is the receiver The first message sent in each message chain will have the ground as receiver The default ground in Ioke source files is an object called code Ground code This object is in the mimic chain for most regular objects created in Ioke which means that things defined at the top level will generally be available in most objects Inside of methods and blocks the ground will be different Exactly in what way is defined by the type of code executing Every message in a chain will be sent to the receiver of that message That receiver is the result of the last message or the current ground if there was no previous message or if that previous message was a terminator So Ioke code like code foo bar flux bar quux code involves 5 different messages

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



  •