Questions tagged [iolanguage]

Io is a pure, prototype-based, object-oriented dynamic programming language.

Io is a prototype-based programming language inspired by

  • Smalltalk (all values are objects, all messages are dynamic),
  • Self (prototype-based),
  • NewtonScript (differential inheritance),
  • Act1 (actors and futures for concurrency),
  • Lisp (code is a runtime inspectable/modifiable tree)
  • and Lua (small, embeddable).

Features

  • BSD license
  • small vm (~10K semicolons)
  • multi-state (multiple VMs in same process)
  • incremental collector, weak links
  • actor-based concurrency, coroutines
  • 64bit clean C99 implementation
  • embeddable
  • exceptions

Philosophy

Io's goal is to explore conceptual unification and dynamic languages, so the tradeoffs tend to favor simplicity and flexibility over performance.

( sources iolanguage.com & Wikipedia )

65 questions
1
vote
1 answer

how to change the value of an element in a list in Io language?

I was wondering how can I change the value of an element in a list in Io language? l := list(4, 6, 3, 8, 10) list(4, 6, 3, 8, 10) I want to change it to: list(4, 5, 3, 8, 10) One way is to use insertAt() and removeAt(), But I want to know whether…
Abshakiba
  • 363
  • 3
  • 8
1
vote
2 answers

How to read from keyboard in Io language?

I simply can't find the way to read from the keyboard. Inside the script file, I tried with this: CLI run CLI setPrompt CLI readLine CLI whatever but it doesn't work.
Rob
  • 21
  • 2
1
vote
1 answer

How to define an xor operator in Io

I'm working through Chapter 3, Day to of Seven Languages in Seven Weeks ("The Sausage King"). I've copied the code straight out of the book, but it's not working. Io 20110905 Add a new operator to the OperatorTable. Io> OperatorTable…
Patrick McElhaney
  • 57,901
  • 40
  • 134
  • 167
1
vote
1 answer

Get slot from containing object in nested object

I have a set of nested objects, and need to get a slot from the containing object. Can it be done? Example: Foo := Object clone do( a := "hello" Bar := Object clone do( b := Foo a # How to get `Foo a` here? ) ) From the above…
Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
1
vote
1 answer

Find all clones of an object in iolanguage

Is there a convenient way to get a list of all objects whose prototype is the given object? I'm inspecting slotNames on Object in an attempt to find a method that might do this, but I'm coming up short. It appears one could scan Lobby, but I thought…
StevenC
  • 1,172
  • 1
  • 9
  • 17
1
vote
1 answer

How do I refer to the list being mapped in Io?

Io allows an optional parameter referring to the index of a list item. How do I use that to refer to the list being mapped, for example, I could write: testList := list(1,2,3,4) testList map(i,v, if(testList(i+v), v, v-1)) and the result would be…
philosodad
  • 1,808
  • 14
  • 24
1
vote
1 answer

how to pass a method but not activate it in io language

I want to implement a method dim(x,y) which will assign spaces for a matrix(y rows, x cols). I want to make "dim(x,y)" more powerful by passing an optional function 'filler' to it and then 'dim' will set the element located at (x,y) to…
Javran
  • 3,394
  • 2
  • 23
  • 40
1
vote
2 answers

Io(language) startup error - .io_history

I installed and was running the Io(language) command line interface fine in OSX but now I'm getting this error on startup: Exception: while loading history file '/Users/andrew/.io_history', reason: No such file or directory Any one have any idea…
andrewleung
  • 552
  • 6
  • 18
1
vote
1 answer

Implemented a linked list. Need help creating a stack and a queue

I have already got a working linked list here: Single_Linked_List := Object clone do( head ::= nil; // constructor init := method( head = nil ); // methods isEmpty := method( self head == nil ); empty := method( …
Derek Meyer
  • 497
  • 7
  • 22
0
votes
1 answer

Io Language Create Class

How can I create a "Class" in Io language? For example, I want to try the following: Dog pd barry := Dog new("Barry") barry pd barry name println // Attribute of the class barry allFoodItemsEaten println // Attribute of the…
Shaco
  • 1
  • 1
0
votes
1 answer

Iolang code works differently between in file and in relp

This is my code: OperatorTable addOperator("xor", 11) OperatorTable println true xor := method(bool, if(bool, false, true)) false xor := method(bool, if(bool, true, false)) true xor(false) true xor false When I type it into relp, it works…
Jian
  • 13
  • 2
0
votes
1 answer

Io - List Shuffling

I tried to shuffle a list in Io: list(1, 2, 3, 4) shuffle println However, when I tried to run the program, Io gave me an error: Exception: List does not respond to 'shuffle' --------- List shuffle .code.tio 1 CLI…
user12188239
0
votes
0 answers

Clone behavior diffent in REPL vs script

I have this piece of code that behaves differently in the io REPL vs running it as a script (i.e. io matrix_clone_test.io). To be specific: in the REPL, matrix1 and matrix2 point to different objects (different ids: Matrix_0x504b80,…
treaz
  • 508
  • 2
  • 6
  • 14
0
votes
1 answer

IO Language How to create a list that has randomly generated values?

I am doing a project for my programming languages class. This one is on the IO Language. My question is is it possible to randomly generate values into an empty cloned list? I've been searching their homepage, but can't find the info I am looking…
Bahak
  • 1
  • 1
0
votes
1 answer

How to multiply two matrices using a list of lists in Io language?

I am learning the Io language and would like to know how to multiple matrices together using lists of lists. Here is my code so far: mA := List clone mA := list(list(1, 2, 3), list(4, 5, 6), list(7, 8, 9)) mB := List clone mB := list(list(1, 2, 3),…
Kaoteni
  • 49
  • 9