Hatena::Grouprubyist

たばさの RSSフィード

02/18(月) 2008

interpolate, array, md5

| interpolate, array, md5 - たばさの を含むブックマーク はてなブックマーク - interpolate, array, md5 - たばさの

when i wrote interpolation support, it was my goal to also allow interpolation of other languages code (if you have defined a path to an interpreter for it)

http://iota.flowsnake.org/strings.html

=>パスさえ設定すればほかの言語のコードも埋め込めるようにするのが目標だった


http://iota.flowsnake.org/syntax-extensions.html

=>rubypython風の配列もこうやれば出来るよ。それはそうかも。


md5もやった。いちおう出来た気がする。それっぽい文字列。面倒なのでそのまま貼ってみる。動かしている気分を共有。

Io 20070410
Io> b:=6 asRational with(30000000000000001,7000000001)
==> 3.000000e+016/7.000000e+009
Io> b/1
==> 4285714.2851020405
Io> a=b/1
==> 4285714.2851020405
Io> a asRational
==> 4.601751e+015/1073741824
Io> "qwerty" type
==> Sequence


Io> UnitTest assertFalse

  Exception: nil does not respond to 'code'
  ---------
  nil code                             UnitTest.io 40
  UnitTest assertFalse                 Command Line 2
  UnitTest assertEquals                UnitTest.io 52

Io> l:=UnitTest assertFalse

  Exception: nil does not respond to 'code'
  ---------
  nil code                             UnitTest.io 40
  UnitTest assertFalse                 Command Line 2
  UnitTest assertEquals                UnitTest.io 52

Io> l:=UnitTest
==>  UnitTest_0x5deb18:
  assertEquals     = method(a, b, m, ...)
  assertEqualsWithinDelta = method(expected, actual, delta, ...)
  assertFalse      = method(a, ...)
  assertNil        = method(a, ...)
  assertNotEquals  = method(a, b, ...)
  assertNotNil     = method(a, ...)
  assertNotSame    = method(a, b, ...)
  assertRaisesException = method(...)
  assertSame       = method(a, b, ...)
  assertTrue       = method(a, ...)
  fail             = method(...)
  init             = method(...)
  knownBug         = method(...)
  run              = method(...)
  setUp            = method(...)
  tearDown         = method(...)
  testCount        = method(...)
  testSlotNames    = method(...)
  type             = "UnitTest"
  verbose          = method(s, ...)

Io> l assertFalse

  Exception: nil does not respond to 'code'
  ---------
  nil code                             UnitTest.io 40
  UnitTest assertFalse                 Command Line 2
  UnitTest assertEquals                UnitTest.io 52

Io> l assertFalse("6*8")

  Exception: ["6*8" != false] [6*8 != false]
  ---------
  Exception raise                      UnitTest.io 41
  UnitTest assertFalse                 Command Line 2
  UnitTest assertEquals                UnitTest.io 52

Io> l assertFalse(6*8)

  Exception: [6 *(8) != false] [48 != false]
  ---------
  Exception raise                      UnitTest.io 41
  UnitTest assertFalse                 Command Line 2
  UnitTest assertEquals                UnitTest.io 52

Io> l assertNotSame(3==3)
==> false
Io> l assertNotSame(3==4)
==> false
Io> l assertTrue(true)
==> false
Io> l assertTrue(!true)

  Exception: Object does not respond to '!'
  ---------
  Object !                             Command Line 2
  UnitTest assertTrue                  Command Line 2

Io> l assertTrue(false)

  Exception: [false != true] [false != true]
  ---------
  Exception raise                      UnitTest.io 41
  UnitTest assertTrue                  Command Line 2
  UnitTest assertEquals                UnitTest.io 51

Io> l assertTrue(true)
==> false


Io> u:=User
==>  User_0x5a9298:
  homeDirectory    = User_homeDirectory()
  name             = User_name()

Io> u Homedirectory

  Exception: User does not respond to 'Homedirectory'
  ---------
  User Homedirectory                   Command Line 2

Io> u homeDirectory
==>  Directory_0x578ad8:

Io> u homeDirectory asString
==>  Directory_0x4abf28:

Io> u name
==> ほにゃ
Io> u homeDirectory name
==> Application Data
Io> u homeDirectory path
==> C:\Documents and Settings\ほにゃ\Application Data


Io> m:=MD5 clone
==>  MD5_0x640188:
  appendSeq        = MD5_appendSeq()
  md5              = MD5_md5()
  md5String        = MD5_md5String()

Io> m appendSeq("qwerty")
==>  MD5_0x640188:
  appendSeq        = MD5_appendSeq()
  md5              = MD5_md5()
  md5String        = MD5_md5String()

Io> m md5
==> リW釈Чホ鉀サv・圭、
Io> m md5String
==> d8578edf8458ce06fbc5bb76a58c5ca4
Io> m appendSeq("qwerty")

  Exception: Io Assertion 'cannot append to an already calculated md5'

Io>

usernameはふせてみた

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20080218
カレンダー
<< 2008/02 >>
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29
archive Error : RSSが取得できませんでした。