Arc Forumnew | comments | leaders | submit | jules's commentslogin
2 points by jules 5718 days ago | link | parent | on: Things to know before learning Arc?

If you want to learn Scheme first try How to Design Programs or Structure and Interpretation of Computer Programs (both free online). HtDP is more beginner oriented, so if you can program I recommend SICP. There are valuable lessons in HtDP even if you are a programmer, but it's not as challenging as SICP so HtDP might be boring.

-----

2 points by jules 5912 days ago | link | parent | on: Another, older wannabe neo-Lisp

How can Qi be type inferring when its type system is turing complete?

-----

1 point by Jekyll 5911 days ago | link

IRC, the type inference is not guaranteed to terminate in pathological cases.

-----

0 points by jules 5858 days ago | link

You mean type checking.

-----

2 points by jules 5915 days ago | link | parent | on: Cut and Index - Arc and Ruby Side By Side

Are you aware that x..y and x...y notation is a Range literal in Ruby? I like Pythons syntax better but range notation isn't special syntax for slices.

obj[a,b,...] is sugar for a method call in Ruby (you can define a [] method for your own classes). So there's really only two syntactic forms here, and arguably no special syntax for slices.

-----

2 points by jules 5915 days ago | link | parent | on: New version

    $ irb
    >> "abcde"[1...-1]
    => "bcd"

-----

3 points by jules 5915 days ago | link | parent | on: New version

In Ruby you use Ranges for this.

    (1..4).to_a => [1,2,3,4]
    (1...4).to_a => [1,2,3]
str[a..b] is a substring from a to b, inclusive.

str[a...b] is a substring from a to b, exclusive.

With negative indices:

    str[a..-b] == str[a..str.length-b]
    "abcde"[1..-1] == "abcde"[1..5-1] == "abcde"[1..4] == "bcde"

    str[a...-b] == str[a...str.length-b]
    "abcde"[1...-1] == "bcd"

-----