Path: news.cs.au.dk!noatun.mjolner.dk!mail-to-news From: Atle Newsgroups: comp.lang.beta Subject: Type system generalisations Date: Mon, 27 Nov 2000 15:13:37 +0100 Organization: Posted to comp.lang.beta by a mailtonews script Lines: 56 Sender: lbr@mjolner.dk Approved: mailtonews@cs.au.dk Message-ID: <8vumg8$7ece6$1@gjallar.cs.au.dk> NNTP-Posting-Host: bifrost.mjolner.dk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: gjallar.cs.au.dk 975363400 7811526 130.225.4.254 (27 Nov 2000 22:16:40 GMT) X-Complaints-To: usenet@cs.au.dk NNTP-Posting-Date: Mon, 27 Nov 2000 22:16:40 +0000 (UTC) Mailing-List: contact usergroup-help@mjolner.dk; run by ezmlm X-No-Archive: yes X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14 i686) X-Accept-Language: en X-Original-Message-ID: <3A226C11.A267D1BD@skynet.be> X-Original-Sender: atle@skynet.be Xref: news.cs.au.dk comp.lang.beta:12654 I just read Brandt and Knudsen: Generalising the Beta type system and remembered that I had seen, can't remember where, some code like this i:@INTEGER; j:@i; .... And I had actually (I swear) noticed the 'bizarrity' of a pattern reference to a singular object, but I didn't think much about it, I am so used to accept things like that as a matter of course. I actually thought that it was 'suuposed to be like that' ... Will this generalised type system be part of a new Mjølner release? I would much prefer that over, for example, dynamic exceptions, and it after all, it IS SOON JUL! Then, one stupid question (to follow tradition): I have also fiddled with Icon, and fell in love with the generators. It was when searchin for 'generator' stuff on the Net that I first stumbled over Beta. So, when I read about one kind of generalisation, my twisted mind think of another ... In Icon, as you may or may not know, there is a keyword 'every', that loops through all generated items much like Beta scan(# ... #) does, but it is a built-in. So, if [a,b,c,d,e] is a list, every i := ![a,b,c,d,e] do { something with i } will loop through the list. The ! tells it to generate al items. every i := 1 to 100 do { ... } will do (for i:100 repeat ... for) Sometimes I have wanted a Beta contruct like this (FOR e:Mylist REPEAT .. FOR) where mylist is not an integer, but an arbitrary generator pattern or repetition, and e is qualified the same way as the generator's EXIT list, the repetition elements, etc. I suppose that the current syntax would have to be some sort of special case of a general (FOR i:generator ...) syntax and that @INTEGER would have to also gecome a generator for it to work (or maybe not?) I know this would break the consistency a little, but is there a very brief explanation why this was not made part of the language? I know there has to be a very good reason, I just can not for the life of me think of which one ... Then I want to say that the help I have received with my questions, code samples and stuff has done more than just help me with those specific problems. The suggested changes and implementations have opened up a whole new horizon for me, and I only now I feel that I am starting to grasp what Beta is about. I am becoming more and more of a dedicated fan, and every time I get a chance, I tell people that I explore Beta, the pattern-oriented language, without giving the www.mjolner.com reference. It never fails, the response is: "Beta? What's that? And what is 'pattern ..' whatever?" Then I have my standard answer ready: "Beta is now what Simula was in the 1960s. Pattern-oriented programming is now what Object-oriented programming was in the 1960s. You can say that Beta is to Java and C++ what Java and C++ were to Basic and COBOL. The reference is www.mjolner.com ..." The implication is: "You can either learn Beta or become a computer illiterate ..." I know for a fact that you get a hit on your website every time I do that, because they always get back to be with something the have read on the site. For now, that is my way of saying thanks :-) Best wishes, Atle