From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: Re: a new language, designed for safety ! Date: Sun, 22 Jun 2014 20:47:59 -0500 Organization: Aioe.org NNTP Server Message-ID: References: <3bf7907b-2265-4314-a693-74792df531d1@googlegroups.com> <8SKpv.25283$CO1.5252@fx15.iad> Reply-To: nma@12000.org NNTP-Posting-Host: +bGw3iKtw0btMD059xlTWg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:20543 Date: 2014-06-22T20:47:59-05:00 List-Id: On 6/22/2014 7:51 PM, Shark8 wrote: > > IIRC, Lisp's Error-handling can ensure that types are consistent, even > though the language itself is dynamically typed. > Julia can do that also, and it is dynamically typed. But for Julia to check at run-time the types are correct, one must supply the type expected from an operation. I am newbie in Julia, but I find how its type system works a bit confusing to me: julia> x=int8(3) %decalre x to be int8 type julia> typeof(x) Int8 julia> y=int64(300000) %y is int64 julia> typeof(y) Int64 julia> y=x %value of x into y 3 julia> typeof(y) %now y type changed to that of x ! Int8 julia> y=int64(300000); %lets start again julia> (y=x)::Int64 %but now add assertion ERROR: type: typeassert: expected Int64, got Int8 julia> y=x %without assertion, it works, but type conversion happens 3 So in Julia, the run-time will check the type, but the user must add assertions :: --Nasser