From mickael.remond@REDACTED Thu Jul 3 18:54:46 2003 From: mickael.remond@REDACTED (Mickael Remond) Date: Thu, 3 Jul 2003 18:54:46 +0200 Subject: Linux Journal's 2003 Readers' Choice Message-ID: <1057251286.bdb757cac6132@webmail.spamcop.net> Hello, This year, Erlang/OTP has been officially included in the favorite programmation language section for Linux Journal's 2003 Readers' Choice: http://www.linuxjournal.com/rc2003/ Voting will end July 25, 2003. So, does your duty and help us spread the word about your favorite programming language (hint ! hint ! It starts with an "E"). Cheers, -- Micka?l R?mond http://www.erlang-projects.org/ From mickael.remond@REDACTED Thu Jul 3 18:50:32 2003 From: mickael.remond@REDACTED (Mickael Remond) Date: Thu, 3 Jul 2003 18:50:32 +0200 Subject: Welcome back online, Erlang.org Message-ID: <1057251032.ef1d69e77c696@webmail.spamcop.net> Hello, I am sending this message to test the mailing list and let you know that the erlang.org and erlang.se websites are back online. Cheers, -- Micka?l R?mond From ulf.wiger@REDACTED Thu Jul 3 19:53:35 2003 From: ulf.wiger@REDACTED (Wiger Ulf) Date: Thu, 3 Jul 2003 19:53:35 +0200 Subject: Window focus discipline Message-ID: <001301c3418c$07113160$fd7a40d5@telia.com> Finally, the list is back! :-) Having just fired up my old PC at home, I'm as usual extremely annoyed with the disgustingly undisciplined Windows programs, all trying to grab focus over and over while starting up. Needless to say, X-Windows environments are a lot more disciplined. Still (considering the apparent urge on this list to invent new graphics environments), I was wondering if the most well-behaved of windowing environments shouldn't actively monitor keyboard and mouse activity in the active window, and not throw up a new window in front while the user is obviously doing stuff. That is, if I start two applications, and one comes up and I start using it right away, at least I would prefer it if the other application stay completely in the background, and don't steal focus from the application I'm currently using. /Uffe From serge@REDACTED Thu Jul 3 21:55:30 2003 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 03 Jul 2003 15:55:30 -0400 Subject: Window focus discipline References: <001301c3418c$07113160$fd7a40d5@telia.com> Message-ID: <3F048A32.2010101@hq.idt.net> Wiger Ulf wrote: > Finally, the list is back! :-) > > Having just fired up my old PC at home, I'm as usual extremely annoyed > with the disgustingly undisciplined Windows programs, all trying to > grab focus over and over while starting up. Needless to say, X-Windows > environments are a lot more disciplined. Still (considering the apparent > urge on this list to invent new graphics environments), I was wondering > if the most well-behaved of windowing environments shouldn't actively > monitor keyboard and mouse activity in the active window, and not > throw up a new window in front while the user is obviously doing > stuff. > > That is, if I start two applications, and one comes up and I start > using it right away, at least I would prefer it if the other application > stay completely in the background, and don't steal focus from > the application I'm currently using. > > /Uffe I think this behavior was implemented (or should I say "fixed" :-) ) in Windows XP (unless the application writer chooses a "stay-on-top" behavior that forces a splash screen or another window to move to the top of the Z-order window stack). Serge From p-news@REDACTED Fri Jul 4 03:29:03 2003 From: p-news@REDACTED (Per Einar =?iso-8859-1?q?Str=F6mme?=) Date: Fri, 4 Jul 2003 03:29:03 +0200 Subject: Must-have Warning: long Message-ID: <200307040329.03037.p-news@telia.com> Hej ! I'll just have to by joining the choir: Welcome back online, Erlang.org ! Warning: long... I'm a bit curious about how You work developing various types of ERLANG programs for different applications. I'm not at all interested in a description of the p r o c e s s but more in what tools you use when, why and how. All the steps below all have their own quirks, tips, tricks and considerations which I (after reading the list) can see people having some solution for or way around. It would be interesting to gather some of them. How is a process I guess. Some answers are already there in the OTP documentation, somethimes the answers are a bit confusing, resulting in "still confused but on a higher level". Please note that I'm not whineing, trying to be constructive. Maybe a division of the problem into something like the following will explain what I'm after and might serve as a startingpoint for a discussion: HW-Platform | | | Embedded----> +-----+---...---+--------+------+--------+---------+-----... Intel SUN Intel Mot Mot Hitachi NEC X86 Sparc StrongARM 68XXX PowerPC SH3 MIPS | | OS | | +------+------+-----+-------+-----... | | | | | | | | *NIX WIN VxWorks OSE | | | +-----... | | +------+-------+-------+-------+--.......lots and lots Solaris Linux NetBSD FreeBSD OpenBSD | | +-------+ | | Distribution | | +------+------+--------....and so on Red Hat SuSE Debian | | | -------------- Since you already have a clue, you have chosen some sort of development environment including some sort of revision handling of code (CVS,...) Some graphical frontend for it (I.E. CVS) Some storing environment (sourceforge.net, freshmeat.net, home,... ) Build support (make, erlmake, .... ?) -------------- | | | -------------- You worry a bit over: Erlang packages Erlang applications -------------- | | | -------------- The text is stolen from SYSTEM PRINCIPLES, you thinker a little bit around: * Starting the system * Re-starting and stopping the system * Command line arguments * The boot file * Code loading strategies * Making a boot file * Starting the system with a boot file * Code loading strategy * Making an embedded system * The primitive loader. -------------- | | | -------------- And then you think about the development of your application using some combination of ERLANG and some other language probably depending on application. -------------- | | | -------------- Erlang and world out there: Erlang to the world UBF Something happend to this adress: http://www.sics.se/~joe/index.html Erlang to a port erlang:*port*(...) Erlang to C Erl_Interface library (part of OTP) Erlang to C Erlang Driver Tool Kit (EDTK) (http://www.snookles.com/erlang/edtk) Erlang to C IG - The Interface Generator (http://www.bluetail.com/~tobbe/ig/doc.new/) Erlang to C++/C#/aso. ?? Erlang to Java Jinterface Application (part of OTP) IDL to CORBA erl_corba IC Application (part of OTP) IDL to plain Erlang erl_plain IDL to Erlang gen_server erl_genserv IDL to C client c_client IDL to C server c_server IDL to Java java Erlang to SQL-databases ODBC Application Erlang to SNMP SNMP Application Erlang to Asn1 Asn1 application -------------- | | | -------------- Maybe there is some higher level interfacing: Erlang to The internet Inets application Erlang distribution using SSL SSL application Erlang to anyone using CRYPTO Crypto application Erlang to the Megaco/H.248 protocol Megaco application -------------- | | | -------------- And pherhaps interfacing the other way around: Other languade to the Mnesia DBMS Mnesia_Session application -------------- | | \|/ . A.s.o. =========================== A PRACTICAL EXAMPLE: -------------- A practical example, which coincide with my special interest at the moment. You and I and some of our friends want to interface a PCI-buss board of some sort added to your Intel based NNAP PC (no name, assembled parts, PC) running Linux from a SuSE distribution. -------------- | | | -------------- Buy a PCI-buss board which is supported by a Linux driver. Interface Erlang to the driver using the "Erl_Interface library" or what else ?? Well, everyone in this tiny group wants to get their hands dirty. Do we start using CVS through some graphical frontend XX at greatsourcemeat.net building everything localy using YYmake. -------------- | | | -------------- We partition the design into a number of modules in packages (see http://www.erlang.se/publications/packages.html or http://www.it.uu.se/research/reports/2000-001/ ) creating some applications. Design Principles: http://www.erlang.org/doc/r9b/doc/design_principles/part_frame.html Lots of tedious work to do... -------------- | | | -------------- We try to create some start, stop and loading of the design Have a look in System Principles: http://www.erlang.org/doc/r9b/doc/system_principles/part_frame.html The INTEROPERABILITY TUTORIAL describes how to "integrating a program written in Erlang with a program written in another programming language, from the Erlang programmer's point of view." http://www.erlang.org/doc/r9b/doc/tutorial/part_frame.html Ahaa, in the ERTS USER'S GUIDE http://www.erlang.org/doc/r9b/erts-5.2/doc/html/part_frame.html a friendly description on: "How to implement a driver" There are som additional hints in chapter: 3.2 The driver Also check in the ERTS REFERENCE MANUAL the Module erl_driver and Module driver_entry http://www.erlang.org/doc/r9b/erts-5.2/doc/html/application_frame.html -------------- | | | -------------- Then we are in some trouble. We need to debugg the c-environment part. The PCI-buss board driver need to be investigated. The C to Erlang interface need some debugging. There are a number of debuggers around some included in emacs, which ones do we choose and when do we use them. The loading and start of the Erlang node need som investigation. This is an interresting situation, how do we do ? We find erlang:display(Term) In the ERTS USER'S GUIDE http://www.erlang.org/doc/r9b/erts-5.2/doc/html/part_frame.html "How to interpret the Erlang crash dumps" -------------- | | | -------------- Puuh, now things are looking better, now we need to debugg the erlang part of the design. There is a number of debugging tools available, which one do we use when ? The Application Monitor, Appmon Debugger is a graphical tool Sequential tracing Module seq_trace We find some other functions in the module erlang: erlang:trace() erlang:trace_pattern() The OBSERVER application contains tools for tracing and investigation of distributed systems. The Event Tracer (ET) uses the built-in trace mechanism in Erlang and provides tools for collection and graphical viewing of trace data. The process manager PMAN is a graphical tool used to inspect the Erlang processes executing either locally or on remote nodes. In GETTING STARTED WITH ERLANG there is a chapter on the use of PMAN. DBG, the Text Based Trace Facility in the Runtime_Tools Module- -------------- | | | -------------- Now, at last, the thing is working. #?%&-- there seems to be some sort of degradation. Maybe we need to profile our baby. How and using what ? Aahaa, the Efficiency Guide http://www.erlang.org/doc/r9b/doc/efficiency_guide/part_frame.html Ahh we got THE TOOLS APPLICATION contains a number of stand-alone tools, which are useful when developing Erlang programs. The operating system monitor OS_Mon monitors operating system disk and memory usage etc. In the User's Guide for THE ERLANG RUNTIME SYSTEM APPLICATION ERTS we find this description "Match specifications in Erlang" which is used as parameters to a function as used in the erlang:trace_pattern/2 This is realy heavy stuff. -------------- | | | -------------- Hopefully something works here. Else try the mailing list :-) -------------- | | | -------------- Finished... Since they aparently are muddling around at SICS with Joe Armstrongs WEB-pages I hav'nt been able to refer to any tutourials or info on UBF, written by Joe and stored at: http://www.sics.se/~joe The above is not a straight forward question but developing software is not straight forward either (yet). Hoping to hear from you ! Rgrds Per Einar -------------------------------------------------------------------------------- Per Einar Str?mme p-news@REDACTED -------------------------------------------------------------------------------- From matthias@REDACTED Fri Jul 4 07:30:54 2003 From: matthias@REDACTED (Matthias Lang) Date: Fri, 4 Jul 2003 07:30:54 +0200 Subject: What decides the name of a module? In-Reply-To: References: Message-ID: <16133.4366.2009.90114@antilipe.corelatus.se> Roger Price writes: > What decides the name of a module? the -module directive > Is the module name specified by the declaration -module(.) or implied by > the source file name? - or are there two different notions of "module" > that I am confusing? The convention is that the module name matches the file name. If you want to break that convention, you have to provide your own code loading mechanism. Example: let's insist on putting a module called "roger" in a file called "rabbit.erl". One way to load it is: 9> compile:file("rabbit.erl"). {ok,roger} 10> f(), {ok, Bin} = file:read_file("rabbit.beam"). {ok,<<70,79,82,49,...>>} 11> code:load_binary("roger", "rabbit.beam", Bin). {module,"roger"} Matthias From ingela@REDACTED Fri Jul 4 08:47:13 2003 From: ingela@REDACTED (Ingela Anderton) Date: Fri, 4 Jul 2003 08:47:13 +0200 Subject: What decides the name of a module? References: <16133.4366.2009.90114@antilipe.corelatus.se> Message-ID: <16133.8945.977498.790343@gargle.gargle.HOWL> Matthias Lang wrote: > The convention is that the module name matches the file name. If you > want to break that convention, you have to provide your own code > loading mechanism. If you use the Erlang mode for Emacs it would detect this when you try saving your module and offer to change it so that it follows the convention. -- /Ingela Ericsson AB - OTP team P.S. Please note that in the upcoming release of Erlang/OTP the Erlang mode will be better and improved, and also it will be documented :) From sean.hinde@REDACTED Fri Jul 4 10:48:09 2003 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 4 Jul 2003 09:48:09 +0100 Subject: Name Resolver timeout Message-ID: <3CB20647-ADFC-11D7-B84D-000A95927CCE@mac.com> Hi all, I've noticed that inet:gethostbyname/1 times out after about 8 seconds (when using native mode). Does any one know of a way to increase this timer other than poking directly into inet_db? Or is that about as close as there is to an approved method at the moment? I guess the following comment found in inet.erl should probably give me a clue but I am an eternal optimist :) %% Fixme: add (global) timeout to gethost_native Sean From erlang@REDACTED Fri Jul 4 15:01:37 2003 From: erlang@REDACTED (Inswitch Solutions - Erlang Evaluation) Date: Fri, 4 Jul 2003 15:01:37 +0200 Subject: List the atoms defined Message-ID: <001901c3422c$67f46510$1e00a8c0@design> No se pudo mostrar el mensaje Outlook Express encontr? un problema al mostrar el mensaje. Compruebe el equipo dispone de memoria y espacio en disco suficientes y vuelva a intentarlo. -------------------------------------------------------------------------- Outlook Express From erlang@REDACTED Fri Jul 4 15:02:02 2003 From: erlang@REDACTED (Inswitch Solutions - Erlang Evaluation) Date: Fri, 4 Jul 2003 15:02:02 +0200 Subject: List the atoms defined Message-ID: <002601c3422c$76bbf6d0$1e00a8c0@design> Is there a function to list the atoms defined ? Thanks to all, Eduardo Figoli INSwitch Solutions -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Vanwoerkom@REDACTED Sat Jul 5 23:47:14 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Sat, 5 Jul 2003 23:47:14 +0200 (MEST) Subject: Trouble with erlang-questions@erlang.org and www.erlang.org Message-ID: <200307052147.h65LlEK22952@bonsai.fernuni-hagen.de> Thank you for reviving erlang.org Last weekend was the ICFP 2003 contest, and it was really bad luck that you went offline then. The other bad timing was that I found out relative late about the contest date, just a few days before. I hoped to join a team competing in Erlang, as tester or junior member (relating to Erlang experience, not physical age :) but found none. The mailing list was down, nobody alive showed up on an erlang IRC channel I watched, no reaction to my message put on the Erlang wiki, no reaction from other competitors who read the contest web q&a forum (which was a bit misused for sideline communications). Where were you people? :) The nice folks on #haskell at irc.freenode.net offered me to learn Haskell in the remaining 1.5 hours before contest start, but I decided rather to learn Erlang in that time span :) and went on alone. The experience was rather mixed. I really like coding in Erlang. But I have mixed feelings about the documentation. Probably everything that is there, is described in detail somewhere. So the reference is fine. But advice on how to make good use of existing features for certain problems is not enough in my humble opinion. This year's problem was reading in a race track and calculating an optimal sequence of control commands for the racing cart, goal was to minimize race time. The maths was given and the formulas for the physical model. A bit nasty was that we had three updates of the specs during the contest, but that involved mostly the extended sim for a tiebraker match, which is very likely not needed at all. So I had to learn to read in tracks in .trk format and write them as PNM graphics to visualize them in the GIMP. I also wrote routines to read PNM graphics and output .trk race tracks. So could use GIMP as editor. I hade some trouble to get decent performance for reading (ok) and writing (lousy) these files, each covering 1024x768 squares. To find out, how to do that I/O at all, I looked at the yaws sources to learn some tricks. But the first problem was how to store matrix data of the given size using Erlang. I decided to use the RAL package, because I could realize a vector data structure with it. Perhaps some other solution would have been better (ets?) but I had no time to do much research. The other problem was how to implement the simulator code in Erlang. It was given as an imperative description with many ifs and whiles and I am not sure if my transcription into functional Erlang is adequate. I had differences in my test runs in the x,y,v,direction data compared to the official test dump, and it turned out that I made a mistake translating V-= F0 + foo into V2 = V - F0 + foo .. instead of V2 = V - (F0 + foo ..). Hmn. As a one man show I was not fast enough in Erlang to solve the real problem: optimizing the tracks. So I took much time to create several race tracks, which was fun. I also recognized the canonical way how to solve the problem: This was a problem from theory of optimal control, which is a generalization of optimization theory. There one looks at a differential equation m dv/dt = F + C where F is the force term that describes the physical behaviour of the system (in the contest: movement with linear and quadratic friction) and C is an additional force that is used to control the movement (in the contest: accelerating, braking, turning left, turning right). The task is to choose C in a way that a certain quantity is optimal (in the contest: the racing time is minimal). It is possible to solve for that C, but the examples I could remember needed some nasty matrix maths. Too bad I had no literature on control theory at hand, but even so, formulating the problem right, applying a solution and coding the solution would not have been possible for me in time. So I would have gone for a route as well, that many participants chose. Drawing manually a track in the GIMP and using that as first order approximation of an optimal trajectory. But I came not close to trying that out. Some weird experience in between was transfering my code on a Windows box and there it hung. I don't know if perhaps some \n vs \r\n problematic hid there, and I had no time to find out. Very useful was Erlang's integer arithmetic. Too bad I recognized my coding error too late. All in all it would have been easier if one had more folks than one on a team. (Ok, there were some single guy teams who managed to solve tracks, my deep respect to them). I also wonder if one should prepare some optimization frameworks just in case for next year's contest. Regards, Marc From rprice@REDACTED Sun Jul 6 00:21:58 2003 From: rprice@REDACTED (Roger Price) Date: Sun, 6 Jul 2003 00:21:58 +0200 (CEST) Subject: What decides the name of a module? In-Reply-To: <16133.8945.977498.790343@gargle.gargle.HOWL> Message-ID: > Matthias Lang wrote: > > > The convention is that the module name matches the file name. If you > > want to break that convention, you have to provide your own code > > loading mechanism. Hello Matthias, Thanks for the clarification. It seems to me that this convention is fundamental to Erlang. I think it would be helpful if the compiler issued a stern warning if it found -module(x) in file y.erl and x/=y. Roger From rprice@REDACTED Sun Jul 6 00:21:22 2003 From: rprice@REDACTED (Roger Price) Date: Sun, 6 Jul 2003 00:21:22 +0200 (CEST) Subject: Erlang mode for Emacs In-Reply-To: <16133.8945.977498.790343@gargle.gargle.HOWL> Message-ID: On Fri, 4 Jul 2003, Ingela Anderton wrote: > P.S. Please note that in the upcoming release of Erlang/OTP the Erlang > mode will be better and improved, and also it will be documented :) Hello Ingela, I'm glad to hear about the new documentation, I tried to install R9B erlang.el following the README: ;; Erlang major mode;; For UNIX (setq load-path (cons "/usr/local/lib/erlang_R9B-0/misc/emacs" load-path)) (setq erlang-root-dir "/usr/local/lib/erlang_R9B-0/") (setq exec-path (cons "/usr/local/lib/erlang_R9B-0/bin" exec-path)) (require 'erlang-start) but got an error massage from emacs saying File error: "Cannot open load file", "erlang-start" Should that 'erlang-start be something else? Roger From joachim.durchholz@REDACTED Sun Jul 6 02:13:59 2003 From: joachim.durchholz@REDACTED (Joachim Durchholz) Date: Sun, 06 Jul 2003 02:13:59 +0200 Subject: Entry in free compilers list Message-ID: <3F0769C7.5080606@web.de> Hi to the Erlang team, I just noticed that Erlang is not mentioned on the free compilers list that's regularly posted on comp.compilers (and possibly elsewhere as well). I'd suggest submitting an entry, simply to keep the record straight :-) To get the thing started, I have copied the blank prototype entry and filled things in as far as I could; I have attached the results as a text file (to keep line breaks intact). Things where I were unsure or had no information are enclosed in [[double brackets]]. I hope we will soon see Erlang in the Free Compilers List :-) Regards, Jo -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Free Compilers Entry.txt URL: From matthias@REDACTED Sun Jul 6 09:24:42 2003 From: matthias@REDACTED (Matthias Lang) Date: Sun, 6 Jul 2003 09:24:42 +0200 Subject: What decides the name of a module? In-Reply-To: References: <16133.8945.977498.790343@gargle.gargle.HOWL> Message-ID: <16135.52922.230566.797339@antilipe.corelatus.se> mml> The convention is that the module name matches the file name. > I think it would be helpful if the compiler issued a stern warning > if it found -module(x) in file y.erl and x/=y. E.g. like this: 1> c(rabbit). ** Module name 'roger' does not match file name 'rabbit' ** {error,badfile} :-) Lower level interfaces to the compiler (e.g. erlc or compile:file) don't tell you, though you'll notice when you try to load the file. Matthias From rvg@REDACTED Sun Jul 6 12:37:21 2003 From: rvg@REDACTED (Rudolph van Graan) Date: Sun, 6 Jul 2003 12:37:21 +0200 Subject: Mnesia and the performance of variable size records In-Reply-To: Message-ID: Hi all, I have a question regarding the use of records with fields where the content size changes. As an example, take the following record: -record(some_record, {key,field1,detailrecords=[]}). This is stored in mnesia as an ordered set. What would the performance implications be where you have a large number of records, where the content of detailrecords is a list, where the size is not constant? In a relational database, one would normally define a field with a specific size or of variable length and the database will allocate pages for the storage of the extra data. How does mnesia do this? If I have to guess for best performance in mnesia, the records all need to be more or less the same size? We can potentially have millions of records like this, but the size of the variable field is a couple of entries, usually less than 10. The reason I would want to do this, is to avoid having a table with detail rows and include the detail rows simply as a list in the master record. Doing this would avoid a query on a second table, but I am not sure how the performance of the master table would suffer doing it this way. The structure that I would like to represent looks somewhat like: . . . . . . The relational database schema would have been: Table 1: *Key Data Data Table 2: *Key *Index *Data *Data My mnesia implementation simply stores the detail records as items in a list, where the list is a field of the master record. Obviously, this makes the coding trivial, but what performance implications does this have? Thank you again! Rudolph From sean.hinde@REDACTED Sun Jul 6 17:23:52 2003 From: sean.hinde@REDACTED (Sean Hinde) Date: Sun, 6 Jul 2003 16:23:52 +0100 Subject: Mnesia and the performance of variable size records In-Reply-To: Message-ID: On Sunday, July 6, 2003, at 11:37 AM, Rudolph van Graan wrote: > Hi all, > > I have a question regarding the use of records with fields where the > content size changes. As an example, take the following record: > > -record(some_record, > {key,field1,detailrecords=[]}). > > This is stored in mnesia as an ordered set. > > What would the performance implications be where you have a large > number of records, where the content of detailrecords is a list, where > the size is not constant? In a relational database, one would normally > define a field with a specific size or of variable length and the > database will allocate pages for the storage of the extra data. How > does mnesia do this? If I have to guess for best performance in > mnesia, the records all need to be more or less the same size? We can > potentially have millions of records like this, but the size of the > variable field is a couple of entries, usually less than 10. This is exactly how we use mnesia and it works well. As far as I can tell what happens is that the underlying ets table allocates just as much memory as it needs for each new row regardless of the size of the entry - hence there is no additional performance impact in creating variable sized rows. If the same row is overwritten with a larger entry sometime later then ets "flags" the old entry as deleted and creates a new entry. There is presumably a slight performance hit at this point but nothing very noticeable. If the new entry the the same size (or smaller I think?) then the old one is just overwritten. ets re-hashes itself at various trigger points at which times the entries flagged for deletion are removed completely. It all works extremely well in my experience while remaining very fast indeed. Sean From apeake@REDACTED Mon Jul 7 06:36:12 2003 From: apeake@REDACTED (Alex Peake) Date: Sun, 6 Jul 2003 21:36:12 -0700 Subject: ODBC Message-ID: In looking through the ODBC documentation, I do not see a way to bind parameters, as in: "INSERT INTO Customer (FirstName, LastName, Street, City, State, Zip) VALUES(?,?,?,?,?,?)" and SQLBindParameter() Is this available? Was it omitted for a reason? Is it possible for a mere mortal to add? Alex From apeake@REDACTED Mon Jul 7 06:38:45 2003 From: apeake@REDACTED (Alex Peake) Date: Sun, 6 Jul 2003 21:38:45 -0700 Subject: COMET Message-ID: I see in R9 that COMET has been retired. It was stated that the source (unsupported) would be available. Where could I find this? Alex From ingela@REDACTED Mon Jul 7 09:49:40 2003 From: ingela@REDACTED (Ingela Anderton) Date: Mon, 7 Jul 2003 09:49:40 +0200 Subject: Erlang mode for Emacs References: <16133.8945.977498.790343@gargle.gargle.HOWL> Message-ID: <16137.9748.350986.401871@gargle.gargle.HOWL> Roger Price wrote: > install R9B erlang.el following the README: > > ;; Erlang major mode;; For UNIX > (setq load-path (cons "/usr/local/lib/erlang_R9B-0/misc/emacs" > load-path)) > (setq erlang-root-dir "/usr/local/lib/erlang_R9B-0/") > (setq exec-path (cons "/usr/local/lib/erlang_R9B-0/bin" exec-path)) > (require 'erlang-start) > > but got an error massage from emacs saying > > File error: "Cannot open load file", "erlang-start" > > Should that 'erlang-start be something else? Alas that README is a bit outdated. Try (setq load-path (cons "/usr/local/lib/erlang_R9B-0/lib/tools-2.2/emacs" load-path)) (setq erlang-root-dir "/usr/local/lib/erlang_R9B-0/") (setq exec-path (cons "/usr/local/lib/erlang_R9B-0/bin" exec-path)) The README has been updated for the coming release and there will be a users guide and manual page too. -- /Ingela Ericsson AB - OTP team From ingela@REDACTED Mon Jul 7 12:17:27 2003 From: ingela@REDACTED (Ingela Anderton) Date: Mon, 7 Jul 2003 12:17:27 +0200 Subject: ODBC References: Message-ID: <16137.18615.141282.884716@gargle.gargle.HOWL> Alex Peake wrote: > In looking through the ODBC documentation, I do not see a way to bind parameters, as in: > > "INSERT INTO Customer (FirstName, LastName, Street, City, State, Zip) VALUES(?,?,?,?,?,?)" > > and SQLBindParameter() > > Is this available? Was it omitted for a reason? Is it possible for a mere mortal to add? Well the Erlang ODBC application aims to provide an erlang style programming interface to sql-databases. This means that it tries to provide the functionality that an SQL-user wants, which is not a one to one mapping with the Microsoft ODBC API, as it is a C-API that has to handle memory allocation and stuff that an Erlang programmer does not need to think about. Howere ODBC is a big standard and what functionalty that has been included depends in first hand what our commercial customers have required. The erlang odbc is a fairly small application, so it should not be that hard to get your head around it. It all of course depends on your prior knowledge. The latest version of the documentation includes some design info. (Has only been patch on the windows platform) Also there is some internal documentation at the top of the c-file odbcserver.c The functionality you are talking about was not omitted for any special reason it rather has not been considered yet. If you could explain a little when and why you want to use this functionality it would have a better chance to become part of the official release. -- /Ingela Ericsson AB - OTP team From apeake@REDACTED Mon Jul 7 16:36:00 2003 From: apeake@REDACTED (Alex Peake) Date: Mon, 7 Jul 2003 07:36:00 -0700 Subject: ODBC In-Reply-To: <16137.18615.141282.884716@gargle.gargle.HOWL> Message-ID: The typical use of this functionality is when you have a large number of records to insert or update. If you do not use the parameter binding, then the SQL is parsed by the database for each row. With parameters, the SQL is parsed once, and therefore the time for lots of inserts or updates is lots less. The second issue is a security issue. Without parameters, you can only do string concatenation. Lets say you allow someone to search from a web page. You expect: Name = "SMITH" on web page for SELECT * FROM Customer where Name = '(ValOf Name)' yielding SELECT * FROM Customer where Name = 'SMITH' Instead, they enter "SMITH;DELETE * FROM Customer;" Now you have a disaster. If you use parameter binding, this cannot happen, since the text is purely a string to be searched on. Alex > -----Original Message----- > From: Ingela Anderton [mailto:ingela@REDACTED] > Sent: Monday, July 07, 2003 3:17 AM > To: apeake@REDACTED; erlang-questions@REDACTED > Subject: Re: ODBC > > > > Alex Peake wrote: > > In looking through the ODBC documentation, I do not see a way to bind parameters, as in: > > > > "INSERT INTO Customer (FirstName, LastName, Street, City, State, Zip) VALUES(?,?,?,?,?,?)" > > > > and SQLBindParameter() > > > > Is this available? Was it omitted for a reason? Is it possible for a mere mortal to add? > > Well the Erlang ODBC application aims to provide an erlang style > programming interface to sql-databases. This means that it tries to > provide the functionality that an SQL-user wants, which is not a one > to one mapping with the Microsoft ODBC API, as it is a C-API that has > to handle memory allocation and stuff that an Erlang programmer does > not need to think about. Howere ODBC is a big standard and what > functionalty that has been included depends in first hand what our > commercial customers have required. > > The erlang odbc is a fairly small application, so it should not be > that hard to get your head around it. It all of course depends on your > prior knowledge. The latest version of the documentation includes some > design info. (Has only been patch on the windows platform) Also there > is some internal documentation at the top of the c-file odbcserver.c > > The functionality you are talking about was not omitted for any > special reason it rather has not been considered yet. If you could > explain a little when and why you want to use this functionality it would > have a better chance to become part of the official release. > > -- > /Ingela > > Ericsson AB - OTP team > > > > > > > > > From bjarne@REDACTED Mon Jul 7 21:08:25 2003 From: bjarne@REDACTED (=?iso-8859-1?Q?Bjarne_D=E4cker?=) Date: Mon, 07 Jul 2003 21:08:25 +0200 Subject: 2nd ACM SIGPLAN Erlang Workshop Message-ID: <008401c344bb$2531ce20$620f69d4@segeltorp> All Erlang users, developers, researchers, enthusiasts etc. are invited to the 2nd ACM SIGPLAN Erlang Workshop which takes place at Uppsala university on Friday August 29, 2003. Please see the workshop program and see you all in Uppsala in August! http://www.erlang.se/workshop/2003/ Bjarne -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias@REDACTED Mon Jul 7 23:21:14 2003 From: matthias@REDACTED (Matthias Lang) Date: Mon, 7 Jul 2003 23:21:14 +0200 Subject: what versions of windows does erlang run on? Message-ID: <16137.58442.894788.960117@antilipe.corelatus.se> Hi, I just tried to figure out which versions/flavours/branches of Windows Erlang works on and didn't find an answer on the WWW. This page http://www.erlang.se/productinfo/index.shtml seems to say that it's "not available" for any modern ones. Is that true or is the page just out of date? What about the open source one? I've seem messages from people using Erlang on XP, so it would seem to work. Or are there problems? Matthias From Marc.Vanwoerkom@REDACTED Mon Jul 7 23:58:55 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Mon, 7 Jul 2003 23:58:55 +0200 (MEST) Subject: what versions of windows does erlang run on? In-Reply-To: <16137.58442.894788.960117@antilipe.corelatus.se> (message from Matthias Lang on Mon, 7 Jul 2003 23:21:14 +0200) Message-ID: <200307072158.h67Lwtk28936@bonsai.fernuni-hagen.de> > What about the open source one? I've seem messages from people using > Erlang on XP, so it would seem to work. Or are there problems? The open source one comes with a nice graphical installer, I installed it once on a HP notebook running Windows 98 and on a Windows box runnning Windows 2000/SP3. During ICFP contest I had performance problems, writing out race tracks (both .trk and .pnm formats) was too slow on my K6-300. To my surprise the code developed under FreeBSD did not work under Windows 2000, I can only guess what the reason is, I had no time to investigate yet. Perhaps some problem with Unix \n vs DOS \r\n translation? Or a problem with Samba? To identify problems, one would need some test suite, is there an open source one? Regards, Marc From joachim.durchholz@REDACTED Tue Jul 8 00:59:34 2003 From: joachim.durchholz@REDACTED (Joachim Durchholz) Date: Tue, 08 Jul 2003 00:59:34 +0200 Subject: what versions of windows does erlang run on? In-Reply-To: <200307072158.h67Lwtk28936@bonsai.fernuni-hagen.de> References: <200307072158.h67Lwtk28936@bonsai.fernuni-hagen.de> Message-ID: <3F09FB56.8080706@web.de> Marc Ernst Eddy van Woerkom wrote: > To my surprise the code developed under FreeBSD did not work under Windows 2000, > I can only guess what the reason is, I had no time to investigate yet. > Perhaps some problem with Unix \n vs DOS \r\n translation? This depends heavily on the way your software is digesting (resp. writing) lines. The best way to avoid this kind of problem is installing Cygwin. (That's a Posix/Unix emulation layer for Windows. Not very fast, since it must emulate tons of things that don't quite work the same way under Windows, but the fastes porting path from Unixoid to Windowsish worlds.) > To identify problems, one would need some test suite, is there > an open source one? I would be interested to read where exactly your code failed. I.e. the place where program data didn't match your expectations. Regards, Jo From kent@REDACTED Tue Jul 8 01:09:20 2003 From: kent@REDACTED (Kent Boortz) Date: 08 Jul 2003 01:09:20 +0200 Subject: what versions of windows does erlang run on? In-Reply-To: <16137.58442.894788.960117@antilipe.corelatus.se> References: <16137.58442.894788.960117@antilipe.corelatus.se> Message-ID: Matthias Lang writes: > I just tried to figure out which versions/flavours/branches of Windows > Erlang works on and didn't find an answer on the WWW. This page > > http://www.erlang.se/productinfo/index.shtml > > seems to say that it's "not available" for any modern ones. Is that > true or is the page just out of date? It is out of date. Because there are few customers that use Windows we prioritize support on the Windows versions they use and that are suitable for running Erlang. At the time Windows NT 4 was the only reasonable option. > What about the open source one? I've seem messages from people using > Erlang on XP, so it would seem to work. Or are there problems? The primary Windows testing is done on Windows 2000 but we have also run tests on Windows XP. They perform well compared to the Unix platforms. There seem to be some differences in how "pipes" are handled in different Windows versions or Windows patch levels. I couldn't get the Tcl/Tk wish program to work correctly as a port program on some Windows installations. Some bytes sent seemed to get lost. So I use gen_tcp over localhost instead. I don't know if this is a generic Windows problem or a bug in the wish program. The ODBC driver is a port program and no similar problems have been reported. Erlang OTP R9C can be built from source using Cygwin and VisualC++. In the latest snapshot there is a README.win32 that describe the build process and tools needed. http://www.erlang.org/download/snapshots/ [As a Unix geek I must really say that Cygwin makes my Windows work so much easier. I can log in on my Windows XP machine from a Unix work station at work or home using ssh. From the bash or tcsh shell on my Windows machine I have an "almost" complete Unix environment where I can restart daily builds and tests, reschedule cron jobs, try out corrections to failing test cases etc.] Marc Ernst Eddy van Woerkom writes: > To identify problems, one would need some test suite, is there > an open source one? The test server and some test suites are released as OpenSource http://www.erlang.org/project/test_server/index.html kent From Marc.Vanwoerkom@REDACTED Tue Jul 8 01:35:43 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Tue, 8 Jul 2003 01:35:43 +0200 (MEST) Subject: what versions of windows does erlang run on? In-Reply-To: <3F09FB56.8080706@web.de> (message from Joachim Durchholz on Tue, 08 Jul 2003 00:59:34 +0200) Message-ID: <200307072335.h67NZhp20657@bonsai.fernuni-hagen.de> > This depends heavily on the way your software is digesting (resp. > writing) lines. > The best way to avoid this kind of problem is installing Cygwin. (That's > a Posix/Unix emulation layer for Windows. Not very fast, since it must > emulate tons of things that don't quite work the same way under Windows, > but the fastes porting path from Unixoid to Windowsish worlds.) Why should Cygwin help me here? Do you suggest using Cygwin to compile my own Windows version of Erlang instead of the official open source of Erlang? > I would be interested to read where exactly your code failed. > I.e. the place where program data didn't match your expectations. I'll put my stuff online soon (not today and tomorrow, no time), and will ask for critique of that Erlang code here. I probably goofed a lot. :) Regards, Marc From joachim.durchholz@REDACTED Tue Jul 8 11:59:52 2003 From: joachim.durchholz@REDACTED (Joachim Durchholz) Date: Tue, 08 Jul 2003 11:59:52 +0200 Subject: what versions of windows does erlang run on? In-Reply-To: <200307072335.h67NZhp20657@bonsai.fernuni-hagen.de> References: <200307072335.h67NZhp20657@bonsai.fernuni-hagen.de> Message-ID: <3F0A9618.50103@web.de> Marc Ernst Eddy van Woerkom wrote: > > Why should Cygwin help me here? Cygwin is doing things "the Unix way". IOW you avoid bugs in the Windows port (if there is a Windows port, and if there are bugs in it). You may hit some Cygwin bug, of course, so this isn't a silver bullet. > Do you suggest using Cygwin to compile > my own Windows version of Erlang instead of the official open > source of Erlang? You'd compile a Unix version of Erlang on Cygwin. Programs compiled under Cygwin have an assortment of the typical Unix calls at their disposal. They are still compiled and linked using Windows conventions (you can't run ELF or a.out binaries under Cygwin - at least that's what I remember from last time I looked). They can still access the Windows API, the Unix emulation is in addition to the Windows calls. (Of course, the Unix flavor of any program will not try to access the Windows API, it will use X Windows instead.) Regards, Jo From D.WILLIAMS@REDACTED Wed Jul 9 11:36:38 2003 From: D.WILLIAMS@REDACTED (WILLIAMS Dominic) Date: Wed, 9 Jul 2003 11:36:38 +0200 Subject: Is it possible to have the line of an error? Message-ID: Hello, I have been trying to write Erlang code in the "let it fail" philosophy, e.g. {ok, Content} = file:read_file(filename:join("c:/tmp","test")) instead of: case file:read_file(filename:join("c:/tmp","test")) of {ok, Content} -> handle_content(Content); {error, Reason} -> {error, {read_failed,Reason}} end. As a beginner in Erlang, one problem I have with this is that when it does fail, the information provided (from the shell, for example) is sufficient to know there was a badmatch in a given function, but not at which line in the function. Is it possible to know the line of the failure? I am looking for something like compile options or activating traces, rather than peppering my code with macros and ?LINE... Cheers, Dominic. From thomasl_erlang@REDACTED Wed Jul 9 14:48:38 2003 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 9 Jul 2003 05:48:38 -0700 (PDT) Subject: Is it possible to have the line of an error? In-Reply-To: Message-ID: <20030709124838.91902.qmail@web41906.mail.yahoo.com> --- WILLIAMS Dominic wrote: > Is it possible to know the line of the failure? I am > looking for something like compile options or > activating traces, rather than peppering my code > with macros and ?LINE... Ideally, the system would provide such information on its own, but that is not yet a feature. Parse transforms may be what you want. I have written and used a parse transform (smart_exceptions) that provides line information and a bit more for most exceptions. In the same framework, you can also write your own custom exception handlers. I will prepare it for "external use" and check it into jungerl in a couple of days. Best, Thomas __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From mlogan@REDACTED Wed Jul 9 17:13:17 2003 From: mlogan@REDACTED (Martin J. Logan) Date: 09 Jul 2003 10:13:17 -0500 Subject: Is it possible to have the line of an error? In-Reply-To: References: Message-ID: <1057763596.2832.126.camel@dhcp-lom-194-186.futuresource.com> Dominic, Unfortunately I know of no ideal solution to your problem. Here is the way that I do things. All of my Erlang code is written with OTP and I use SASL and error logger to provide me with a more detailed account of what happened in my code before it failed as well as at failure. I have noticed that many new functional/erlang programmers especially those from a strictly imperative background(I don't know if you fit here) tend to write very long functions with many case & if statements in mimicry of the imperative style and all of its if and else statements. Take a look at your functions and make sure that they are concise. Short concise functions will aid in finding and isolating errors. Aside from this the only thing that helps in familiarity and focus on what various functions return. If I see {badmatch, undefined} and I examine the function that it occurred in and I see, among other things, an application:get_env I know quite well that it returns undefined if the configuration value specified is not present. Cheers, Martin On Wed, 2003-07-09 at 04:36, WILLIAMS Dominic wrote: > Hello, > > I have been trying to write Erlang code in the "let it fail" philosophy, e.g. > > {ok, Content} = file:read_file(filename:join("c:/tmp","test")) > > instead of: > > case file:read_file(filename:join("c:/tmp","test")) of > {ok, Content} -> > handle_content(Content); > {error, Reason} -> > {error, {read_failed,Reason}} > end. > > As a beginner in Erlang, one problem I have with this is that when it does fail, the information provided (from the shell, for example) is sufficient to know there was a badmatch in a given function, but not at which line in the function. > > Is it possible to know the line of the failure? I am looking for something like compile options or activating traces, rather than peppering my code with macros and ?LINE... > > Cheers, > > Dominic. From kent@REDACTED Wed Jul 9 18:12:30 2003 From: kent@REDACTED (Kent Boortz) Date: 09 Jul 2003 18:12:30 +0200 Subject: Please test snapshots of the coming R9C Message-ID: It is now less than a month to the R9C release. The code is frozen but we are still doing some testing, adding some missing documentation and release notes. We try to release the OpenSource version at the same time or closely after the commercial R9C release. To make this release as portable as possible we need your help in building and verifiying the source before we release the OpenSouce R9C-0. We are doing some corrections in the make files so there may be snapshots that don't build but most of them should build without problems. Note that in R9C you can build the Windows binary from source. You need Microsoft Visual C++ and some free tools like Cygwin. The Windows build instructions are in "$SRCROOT/README.win32". The snapshots can be found at http://www.erlang.org/download/snapshots/ Please let us know if there are problems that you think is important to correct before the R9C release, The OTP team From mikpe@REDACTED Wed Jul 9 21:15:26 2003 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 9 Jul 2003 21:15:26 +0200 (MEST) Subject: patch for SO_BSDCOMPAT problem on 2.5 Linux development kernels Message-ID: <200307091915.h69JFQli025522@harpo.it.uu.se> SO_BSDCOMPAT is obsolete since the 2.4 kernels, and now 2.5 kernels log a warning every time it is used. This is a problem since beam uses it unconditionally even though it only makes a difference in very old kernels (2.2 and older). This patch fixes the problem. It performs a runtime kernel version test, since that's what Raimo Niskanen preferred. It would be nice to get this fix into OpenSource R9C-0, even if it's too late for the commercial release. (Tested with kernels 2.2.25, 2.4.21, and 2.5.74.) /Mikael Pettersson The HiPE group. --- otp-0626/erts/emulator/drivers/common/inet_drv.c.~1~ 2003-06-06 13:58:49.000000000 +0200 +++ otp-0626/erts/emulator/drivers/common/inet_drv.c 2003-07-08 19:40:28.000000000 +0200 @@ -6108,6 +6108,43 @@ -----------------------------------------------------------------------------*/ +#if defined(HAVE_SO_BSDCOMPAT) +#if defined(__linux__) +#include +static int should_use_so_bsdcompat(void) +{ + static int init_done; + static int so_bsdcompat_is_obsolete; + + if (!init_done) { + struct utsname utsname; + unsigned int version, patchlevel; + + init_done = 1; + if (uname(&utsname) < 0) { + fprintf(stderr, "uname: %s\r\n", strerror(errno)); + return 1; + } + /* Format is .. + where the first three are unsigned integers and the last + is an arbitrary string. We only care about the first two. */ + if (sscanf(utsname.release, "%u.%u", &version, &patchlevel) != 2) { + fprintf(stderr, "uname: unexpected release '%s'\r\n", + utsname.release); + return 1; + } + /* SO_BSCOMPAT is deprecated and triggers warnings in 2.5 + kernels. It is a no-op in 2.4 but not in 2.2 kernels. */ + if (version > 2 || (version == 2 && patchlevel >= 5)) + so_bsdcompat_is_obsolete = 1; + } + return !so_bsdcompat_is_obsolete; +} +#else /* __linux__ */ +#define should_use_so_bsdcompat() 1 +#endif /* __linux__ */ +#endif /* HAVE_SO_BSDCOMPAT */ + static int udp_inet_init() { return 0; @@ -6167,7 +6204,7 @@ * existing machine doesn't close the socket. (Linux behaves this * way) */ - { + if (should_use_so_bsdcompat()) { int one = 1; /* Ignore errors */ sock_setopt(desc->inet.s, SOL_SOCKET, SO_BSDCOMPAT, &one, @@ -6200,7 +6237,7 @@ * existing machine doesn't close the socket. (Linux behaves this * way) */ - { + if (should_use_so_bsdcompat()) { int one = 1; /* Ignore errors */ sock_setopt(desc->inet.s, SOL_SOCKET, SO_BSDCOMPAT, &one, From mlogan@REDACTED Wed Jul 9 22:55:16 2003 From: mlogan@REDACTED (Martin J. Logan) Date: 09 Jul 2003 15:55:16 -0500 Subject: Please test snapshots of the coming R9C In-Reply-To: References: Message-ID: <1057784115.2832.301.camel@dhcp-lom-194-186.futuresource.com> I just built the latest snapshot on redhat 9.0 and I find that I still must set LANG=en_US when I ./configure and when I gmake for OTP to build. Can this be fixed? I noticed warnings like below in a few files. I hope that the errors will be fixed or the +warn_unused_vars flag will be removed in the default build before the release. Warnings do not do much to instill confidence in new users. /usr/local/src/otp_src_P9C_2003-07-09/lib/stdlib/src/erl_parse.erl:126: Warning: variable 'Ln' is unused Otherwise, as usual, things look great. Cheers, Martin On Wed, 2003-07-09 at 11:12, Kent Boortz wrote: > It is now less than a month to the R9C release. The code is frozen but > we are still doing some testing, adding some missing documentation and > release notes. > > We try to release the OpenSource version at the same time or closely > after the commercial R9C release. To make this release as portable as > possible we need your help in building and verifiying the source > before we release the OpenSouce R9C-0. > > We are doing some corrections in the make files so there may be > snapshots that don't build but most of them should build without > problems. > > Note that in R9C you can build the Windows binary from source. > You need Microsoft Visual C++ and some free tools like Cygwin. > The Windows build instructions are in "$SRCROOT/README.win32". > > The snapshots can be found at > > http://www.erlang.org/download/snapshots/ > > Please let us know if there are problems that you think is important > to correct before the R9C release, > > The OTP team From erlang@REDACTED Wed Jul 9 23:02:21 2003 From: erlang@REDACTED (Erlang Questions) Date: Wed, 9 Jul 2003 18:02:21 -0300 Subject: Fragmented tables in Mnesia Message-ID: <00a601c3465d$6502c8d0$2100a8c0@mnesia> Hi, everyone. Does someone know if it implies lose of performance using mnesia:activity to execute reads and writes in a fragmented table? My question goes to indiscriminately use mnesia:activity even in those cases where the table is not fragmanted (yet). This way, the final user could make its own fragmentations whenever he wants without having to change any code line. It will be a good option if there is no significative overhead in using such function. Or maybe there is some other way to prevent code of writting or reading from a table that could be fragmented in the future. I am new in the "Mnesia Table Fragmenters Club" and my experience is based on the examples found in the documentation. Thanks in advance, Carlos.- -------------- next part -------------- An HTML attachment was scrubbed... URL: From etxuwig@REDACTED Thu Jul 10 00:12:52 2003 From: etxuwig@REDACTED (Ulf Wiger) Date: Thu, 10 Jul 2003 00:12:52 +0200 (MEST) Subject: Fragmented tables in Mnesia In-Reply-To: <00a601c3465d$6502c8d0$2100a8c0@mnesia> References: <00a601c3465d$6502c8d0$2100a8c0@mnesia> Message-ID: On Wed, 9 Jul 2003, Erlang Questions wrote: >Hi, everyone. > >Does someone know if it implies lose of performance using >mnesia:activity to execute reads and writes in a fragmented >table? There is an overhead of one ets:lookup() per read or write operation when you use the mnesia_frag callback for non-fragmented tables. This should be regarded as negligible. >My question goes to indiscriminately use mnesia:activity >even in those cases where the table is not fragmanted >(yet). This way, the final user could make its own >fragmentations whenever he wants without having to change >any code line. It will be a good option if there is no >significative overhead in using such function. You could also make sure that you always use your own function, myDbLib:activity(Kind, Fun), which could start by calling mnesia:activity(Kind, Fun), and later perhaps call mnesia:activity(Kind, Fun, mnesia_frag). >Or maybe there is some other way to prevent code of >writting or reading from a table that could be fragmented >in the future. I am new in the "Mnesia Table Fragmenters >Club" and my experience is based on the examples found in >the documentation. I would not recommend that. My recommentation is to use your own wrapper to mnesia:activity() right from the start. It gives you the most flexibility and "no" overhead. To reiterate, the overhead when using mnesia_frag for non-fragmented tables is minimal, but there is no reason to lock yourself into forever using the mnesia_frag callback either. There are other custom callback modules, e.g. rdbms, and your future requirements may cause you to outgrow mnesia_frag as well. You may even end up wanting to write your own callback module (it's not that difficult). The trick then is not to have mnesia_frag hard-coded in 4711 different places. /Uffe -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson AB, Connectivity and Control Nodes From jay@REDACTED Thu Jul 10 07:46:12 2003 From: jay@REDACTED (Jay Nelson) Date: Wed, 09 Jul 2003 22:46:12 -0700 Subject: BSD Firewall (long) Message-ID: <4.2.2.20030709220455.00d01220@duomark.com> Thanks for all the tips. I got set up with OpenBSD. I chose it because the security seemed to be its strongest point and the tutorials were as good as those I found on the other variants. I've been reading as much as I can and have made significant progress -- I am now booting from a 64MB flash card on a diskless, fanless computer. Total silence. I can hopefully soon eliminate all my other noisy servers. Everything is very similar to Linux in terms of administration (I've used System V, Solaris, Linux and other variants, so at least a lot of the utilities are familiar). I really like the NAT / packet filtering features offered by pf. ipchains may be very similar, but I've never gotten good tutorials on how to use it so I can't tell. With pf I can have multiple firewalls, multiple internal networks, NAT along with packet scrubbing (fixing up bogus headers used in denial attacks), port and address redirection, filtering including even the flags in the TCP headers as well as spam delay and best of all the ability to easily send all packets to a separate machine for logging. I haven't learned how yet, but there seems also the ability to do load balancing and bandwidth reservation. The thing I like best about OpenBSD is that it feels smaller than Linux and that most things are controlled by a single configuration file. I have built a smaller kernel, downloaded a flash disk writer, and am in the process of configuring the firewall. It feels safer because there is less code and because the resources I have used seem to cover the basics very well (it may be that I am just ignorant of all the real problems). Here are some resources that I use, in case others want to do some investigation: OpenBSD http://www.openbsd.org/ Flashdist http://www.nmedia.net/~chris/soekris/ O'Reilly Network LAMP (Linux, Apache, MySQL, PHP, Python, Perl) http://www.onlamp.com/ [Click on BSD, then Securing Small Networks] OpenBSD Journal http://www.deadly.org/ OpenBSD Forums http://www.openbsdforums.org/ > Why not continue using Linux? I was first interested in BSD because I felt Linux wasn't secure enough for a firewall and wanted to look for something that seemed to be more secure. I also prefer something that is less popular and not so large so that I can better understand all the workings and can participate in a community that is choosing a technology for there own reasons rather than trendiness. Bottom line is that I get bored easily and am always looking to learn something new. Don't get me wrong, I like Linux as a desktop and development environment. I needed something that I can easily make into an embedded device because I am convinced that is the future of software. Now is the time to learn the fundamentals before the big companies make it all too complicated. Ultimately I want to assemble a box with built-in dedicated turnkey firewall, database, web / game and email servers with a network of chips for running services written in erlang. If anyone is interested in acquiring any of the following, please let me know what your desires are: 1) OpenBSD diskless firewall appliance plus books on OpenBSD and configuring a pf firewall 2) Pre-installed OpenBSD erlang appliance(s) plus books -- plug N play development PC 3) Single box including OpenBSD firewall plus 5 to 50 processors each preconfigured as an erlang node I am using 500MHz to 1GHz x86 low power mboards in a case measuring 9" x 11.5" x 2" or 23cm x 29cm x 4.5cm jay From per@REDACTED Thu Jul 10 08:25:33 2003 From: per@REDACTED (Per Bergqvist) Date: Thu, 10 Jul 2003 09:25:33 +0300 Subject: Please test snapshots of the coming R9C In-Reply-To: Message-ID: <200307100725.h6A7PXg28883@tessla.levonline.com> Hi, Hipe doesn't build properly with the 07-09 snapshot. erlc -W -bbeam +debug_info -o../ebin hipe_tagscheme.erl /home/perber/build/otp_src_P9C_2003-07-09/lib/hipe/rtl/hipe_tagscheme. erl:695: undefined macro ''P_OFF_HEAP_OVERHEAD'' /home/perber/build/otp_src_P9C_2003-07-09/lib/hipe/rtl/hipe_tagscheme. erl:37: function finalize_bin/4 undefined make[1]: *** [../ebin/hipe_tagscheme.beam] Error 1 m /Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From hakan@REDACTED Thu Jul 10 10:34:36 2003 From: hakan@REDACTED (Hakan Mattsson) Date: Thu, 10 Jul 2003 10:34:36 +0200 (MEST) Subject: Fragmented tables in Mnesia In-Reply-To: Message-ID: On Thu, 10 Jul 2003, Ulf Wiger wrote: Uffe> On Wed, 9 Jul 2003, Erlang Questions wrote: Uffe> Uffe> >Hi, everyone. Uffe> > Uffe> >Does someone know if it implies lose of performance using Uffe> >mnesia:activity to execute reads and writes in a fragmented Uffe> >table? Uffe> Uffe> There is an overhead of one ets:lookup() per read or write Uffe> operation when you use the mnesia_frag callback for Uffe> non-fragmented tables. This should be regarded as Uffe> negligible. Uffe> Uffe> Uffe> >My question goes to indiscriminately use mnesia:activity Uffe> >even in those cases where the table is not fragmanted Uffe> >(yet). This way, the final user could make its own Uffe> >fragmentations whenever he wants without having to change Uffe> >any code line. It will be a good option if there is no Uffe> >significative overhead in using such function. Uffe> Uffe> You could also make sure that you always use your own Uffe> function, myDbLib:activity(Kind, Fun), which could start by Uffe> calling mnesia:activity(Kind, Fun), and later perhaps call Uffe> mnesia:activity(Kind, Fun, mnesia_frag). Uffe> Uffe> >Or maybe there is some other way to prevent code of Uffe> >writting or reading from a table that could be fragmented Uffe> >in the future. I am new in the "Mnesia Table Fragmenters Uffe> >Club" and my experience is based on the examples found in Uffe> >the documentation. Uffe> Uffe> I would not recommend that. My recommentation is to use your Uffe> own wrapper to mnesia:activity() right from the start. It Uffe> gives you the most flexibility and "no" overhead. To Uffe> reiterate, the overhead when using mnesia_frag for Uffe> non-fragmented tables is minimal, but there is no reason to Uffe> lock yourself into forever using the mnesia_frag callback Uffe> either. There are other custom callback modules, e.g. rdbms, Uffe> and your future requirements may cause you to outgrow Uffe> mnesia_frag as well. You may even end up wanting to write Uffe> your own callback module (it's not that difficult). The Uffe> trick then is not to have mnesia_frag hard-coded in 4711 Uffe> different places. As alternative to insert tons of calls to your own activity function myDbLib:activity(Kind, Fun), you could start by using the normal Mnesia API. Later when you feel a need of it, you can change the Mnesia access_module configuration parameter to some customized access callback module (mnesia_frag, rdbms, my_own_callback...) without doing any changes to your old code. /H?kan --- H?kan Mattsson Ericsson High Availability Software, DBMS Internals http://www.ericsson.com/cslab/~hakan/ From mikpe@REDACTED Thu Jul 10 10:47:49 2003 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 10 Jul 2003 10:47:49 +0200 (MEST) Subject: Please test snapshots of the coming R9C Message-ID: <200307100847.h6A8lnew010676@harpo.it.uu.se> On Thu, 10 Jul 2003 09:25:33 +0300, Per Bergqvist wrote: >Hipe doesn't build properly with the 07-09 snapshot. > >erlc -W -bbeam +debug_info -o../ebin hipe_tagscheme.erl >/home/perber/build/otp_src_P9C_2003-07-09/lib/hipe/rtl/hipe_tagscheme. >erl:695: undefined macro ''P_OFF_HEAP_OVERHEAD'' >/home/perber/build/otp_src_P9C_2003-07-09/lib/hipe/rtl/hipe_tagscheme. >erl:37: function finalize_bin/4 undefined >make[1]: *** [../ebin/hipe_tagscheme.beam] Error 1 It seems you configured for shared heap; it builds Ok in the default private heap configuration. /Mikael From snickl@REDACTED Thu Jul 10 12:10:14 2003 From: snickl@REDACTED (snickl@REDACTED) Date: Thu, 10 Jul 2003 12:10:14 +0200 (CEST) Subject: Please test snapshots of the coming R9C In-Reply-To: Message-ID: I came across this with gentoo, and I think somebody else has posted about this issue recently, too: bash-2.05b$ tar xzf otp_src_P9C_2003-07-09.tar.gz bash-2.05b$ cd otp_src_P9C_2003-07-09/ bash-2.05b$ export ERL_TOP=`pwd` bash-2.05b$ uname -a Linux lucy 2.4.20-gentoo-r2 #27 Tue Apr 22 17:37:20 CEST 2003 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz GenuineIntel GNU/Linux bash-2.05b$ ./configure --host=i386-pc-linux-gnu checking host system type... i386-pc-linux-gnu checking for GNU make... yes (make) checking for a BSD compatible install... /bin/install -c checking whether ln -s works... yes checking for ranlib... ranlib creating ./config.status creating Makefile configuring in lib mrunning /bin/sh /home/stefni/dl/otp_src_P9C_2003-07-09/lib/configure --host=i386-pc-linux-gnu --cache-file=.././config.cache --srcdir=/home/stefni/dl/otp_src_P9C_2003-07-09/lib akcreating ./config.status econfiguring in erl_interface/. running /bin/sh /home/stefni/dl/otp_src_P9C_2003-07-09/lib/erl_interface/./configure --host=i386-pc-linux-gnu --cache-file=../../.././config.cache --srcdir=/home/stefni/dl/otp_src_P9C_2003-07-09/lib/erl_interface/. checking host system type... i386-pc-linux-gnu checking for gcc... gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... yes checking whether gcc accepts -g... yes checking how to run the C preprocessor... gcc -E [...] creating ../lib/asn1/c_src/i386-pc-linux-gnu/Makefile creating i386-pc-linux-gnu/config.h ********************************************************************* ********************** APPLICATIONS DISABLED ********************** ********************************************************************* crypto : No usable OpenSSL found jinterface : No Java compiler found ssl : No usable OpenSSL found ********************************************************************* bash-2.05b$ make cd erts/emulator && ERL_TOP=/home/stefni/dl/otp_src_P9C_2003-07-09 make generate depend make[1]: Entering directory `/home/stefni/dl/otp_src_P9C_2003-07-09/erts/emulator' make -f i686-pc-linux-gnu/Makefile generate make[2]: Entering directory `/home/stefni/dl/otp_src_P9C_2003-07-09/erts/emulator' make[2]: i686-pc-linux-gnu/Makefile: No such file or directory make[2]: *** No rule to make target `i686-pc-linux-gnu/Makefile'. Stop. make[2]: Leaving directory `/home/stefni/dl/otp_src_P9C_2003-07-09/erts/emulator' make[1]: *** [generate] Error 2 make[1]: Leaving directory `/home/stefni/dl/otp_src_P9C_2003-07-09/erts/emulator' make: *** [depend] Error 2 The problem seems to be that the part of the build that makes the directories "believes" the --host option, while the part that generates the makefiles goes with autodetection. This gets you trouble when you want to use binaries on different machines, but compile (as always) on the fastest around. CU, SN -- The UNIX equivalent of the "Blue Screen of Death" would be called "kernel panic". It obviously exists, since I have heard and read about it, but I've never been witness to it in my professional career. John Kirch, Networking Consultant and Microsoft Certified Professional (Windows NT) From Erik.Reitsma@REDACTED Thu Jul 10 09:47:34 2003 From: Erik.Reitsma@REDACTED (Erik Reitsma (RY/ETM)) Date: Thu, 10 Jul 2003 09:47:34 +0200 Subject: Please test snapshots of the coming R9C Message-ID: <440A2703A54A8F4FB2AC2AE34F27129D215AD1@ESEALNT889.al.sw.ericsson.se> Hi, > It is now less than a month to the R9C release. The code is frozen but > we are still doing some testing, adding some missing documentation and > release notes. I looked at the code and it seems that my ASN.1 patch for ObjectDescriptor (replacing 'OBJECT_DESCRIPTOR' with 'ObjectDescriptor' in all erlang source) and my erl_tar patch (use the magic 'ustar\0', fixing problems with paths > 100 bytes when untarring with other tar tools) have not yet been included. That is unfortunate, since it means that I will have to patch R9C as I had to patch R9B-1. *Erik. From Zoltan.Toth@REDACTED Thu Jul 10 11:32:38 2003 From: Zoltan.Toth@REDACTED (Zoltan Peter Toth) Date: Thu, 10 Jul 2003 11:32:38 +0200 Subject: Is it a list ? Message-ID: <3F0D32B6.90503@eth.ericsson.se> Hi ! I've made a little test in the Erlang machine: 1> X = [1|2]. [1|2] Now, my big question is, WHAT an object is X ? 2> is_list(X). true So, it is a list, but not a well formed one: 3> list_to_tuple(X). =ERROR REPORT==== 10-Jul-2003::11:09:15 === Error in process <0.26.0> with exit value: {badarg,[{erlang,list_to_tuple,[[1|2]]},{erl_eval,expr,3},{erl_eval,exprs,4},{shell,eval_loop,2}]} ** exited: {badarg,[{erlang,list_to_tuple,[[1|2]]}, {erl_eval,expr,3}, {erl_eval,exprs,4}, {shell,eval_loop,2}]} ** 9> length(X). =ERROR REPORT==== 10-Jul-2003::11:12:42 === Error in process <0.39.0> with exit value: {badarg,[{erlang,length,[[1|2]]},{erl_eval,expr,3},{erl_eval,exprs,4},{shell,eval_loop,2}]} ** exited: {badarg,[{erlang,length,[[1|2]]}, {erl_eval,expr,3}, {erl_eval,exprs,4}, {shell,eval_loop,2}]} ** ... so what is the structure and what are the elements and the length of this weird list ? Thanks for any answer, Zoltan From fredrik.linder@REDACTED Thu Jul 10 14:21:50 2003 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Thu, 10 Jul 2003 14:21:50 +0200 Subject: Contribution to the record- and write-your-own-guards debates In-Reply-To: Message-ID: Hello Folks! I have spent the last two days investigating what values each field in a couple of records in our system can have. Good documentation could perhaps have helped me complete research this earlier, but then I have to be certain that the documentation have been updated correctly whenever a violation to this documetation has occurred. And this I cannot. :-S I so would have loved to see that field value restrictions was a part of the record declaration. But then again, records are tuples (I know, but I guess that's how most of us view them), and hence "not possible". What I really would like to see is a new kind of data container, similiar to records, with at least the following properties: o Named fields (atom names only) o Field value restriction (to be checked at assignment in run-time) o Non-destructable (as with all other types) o Generic field accessors (to be used as guards) o No default values (don't mix declaration with definition) o Un-ordered fields (field order is of absolutely no interest) It would be nice if the field value restrictors and the value specification in Richard's edoc followed the same specification. If this were implemented, then edoc could be a way to assert function arguments and return values! Great! --- And when I'm already at it: I often find myself forced to unnecessary nesting in my code due to the fact that I am disallowed to write my own guards. I usually write ADTs to conceil my data bearers, which is a practis I find very good since it nicely divides my code into good working bricks. But since I am disallowed to write my own guard-functions I cannot match directly on those ADTs, but have to explicitly extract the information and then match on these values instead. This adds an unnecessary complexity level to my code. Please, please, pretty please with sugar on top -- allow user-written guards. I know what I am doing, so please allow me to do this. Guard functions could perhaps be separately specified using a -guards([guard1/1, guard2/0]}) construct. With the common behaviour that the guard fails if the corresponsing code is not loaded. Best Regards to You All /Fredrik From joachim.durchholz@REDACTED Thu Jul 10 14:47:31 2003 From: joachim.durchholz@REDACTED (Joachim Durchholz) Date: Thu, 10 Jul 2003 14:47:31 +0200 Subject: Is it a list ? In-Reply-To: <3F0D32B6.90503@eth.ericsson.se> References: <3F0D32B6.90503@eth.ericsson.se> Message-ID: <3F0D6063.2020806@web.de> Zoltan Peter Toth wrote: > Hi ! > > I've made a little test in the Erlang machine: > > 1> X = [1|2]. > [1|2] A well-formed list has the structure +---+---+ +---+---+ +---+---+ | x | x--->| x | x---> ...-->| x |NUL| +-|-+---+ +-|-+---+ +-|-+---+ | | | V V V data data data This kind of list is written as [data, data, ..., data] in Erlang. Your list is a very short specimen of a not well-formed list, which has the form +---+---+ +---+---+ +---+---+ | x | x--->| x | x---> ...-->| x | x ---> data +-|-+---+ +-|-+---+ +-|-+---+ | | | V V V data data data The final link of the "list spine" at the right side is what makes the list "not well-formed". (This is the only way to make a list not well-formed. Other data structures usually have more ways to be not well-formed, but lists are so simple that there's just a single way.) This kind of list is written as [data, data, ... | data] in Erlang (note the final | symbol). If a list is constructed using |, the object to the right of the | must be a well-formed list if the total result should be a well-formed list. (Can you see why? (Actually, I'm just too lazy to spell it out *gg*)) Conjecture: I assume you meant to write [1, 2], which will give a well-formed list of the two numbers 1 and 2 :-) > .. so what is the structure +---+---+ | x | x---> 2 +-|-+---+ | V 1 > and what are the elements It's only element is 1. If one accepts that a list tail may be a non-list for a not well-formed list, then 2 is the tail of the list. (Most people wouldn't accept this though.) > and the length of this weird list ? 1. The lenght of a list is the length of its spine. By another definition, the lenght is undefined since the list is not well-formed. HTH Jo From mikpe@REDACTED Thu Jul 10 15:27:10 2003 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 10 Jul 2003 15:27:10 +0200 (MEST) Subject: Please test snapshots of the coming R9C Message-ID: <200307101327.h6ADRA62018971@harpo.it.uu.se> On Thu, 10 Jul 2003 10:47:49 +0200 (MEST), Mikael Pettersson wrote: >On Thu, 10 Jul 2003 09:25:33 +0300, Per Bergqvist wrote: >>Hipe doesn't build properly with the 07-09 snapshot. >> >>erlc -W -bbeam +debug_info -o../ebin hipe_tagscheme.erl >>/home/perber/build/otp_src_P9C_2003-07-09/lib/hipe/rtl/hipe_tagscheme. >>erl:695: undefined macro ''P_OFF_HEAP_OVERHEAD'' >>/home/perber/build/otp_src_P9C_2003-07-09/lib/hipe/rtl/hipe_tagscheme. >>erl:37: function finalize_bin/4 undefined >>make[1]: *** [../ebin/hipe_tagscheme.beam] Error 1 > >It seems you configured for shared heap; it builds Ok >in the default private heap configuration. My mistake -- make completed the build but I forgot that make doesn't halt on errors under lib/ on Linux/RH9 for some reason, and your error did indeed occur in lib/hipe/. The problem is that somehow shared-heap gets enabled by default, but the HiPE compiler currently breaks in that configuration. I'll have a look at the configuration problem later today. /Mikael From luke@REDACTED Thu Jul 10 15:50:15 2003 From: luke@REDACTED (Luke Gorrie) Date: 10 Jul 2003 15:50:15 +0200 Subject: Contribution to the record- and write-your-own-guards debates In-Reply-To: References: Message-ID: "Fredrik Linder" writes: > I often find myself forced to unnecessary nesting in my code due to the fact > that I am disallowed to write my own guards. > > I usually write ADTs to conceil my data bearers, which is a practis I find > very good since it nicely divides my code into good working bricks. But > since I am disallowed to write my own guard-functions I cannot match > directly on those ADTs, but have to explicitly extract the information and > then match on these values instead. This particular problem could be helped by the rumoured "cond" construct. It's like 'if', but uses arbitrary expressions for the tests instead of more restricted guard expressions. I reckon 'cond' would/will be very nice :-) Cheers, Luke (now a big fan of Common Lisp's type system btw) From ulf.wiger@REDACTED Thu Jul 10 14:39:40 2003 From: ulf.wiger@REDACTED (Wiger Ulf) Date: Thu, 10 Jul 2003 14:39:40 +0200 Subject: Fragmented tables in Mnesia References: Message-ID: <001701c346e0$54f88e60$fd7a40d5@telia.com> From: "Hakan Mattsson" > > As alternative to insert tons of calls to your own activity function > myDbLib:activity(Kind, Fun), you could start by using the normal > Mnesia API. Later when you feel a need of it, you can change the > Mnesia access_module configuration parameter to some customized > access callback module (mnesia_frag, rdbms, my_own_callback...) > without doing any changes to your old code. True. I'd still opt for the access library approach, but most likely not just one, but one per (loosely put) category. It still leaves some additional options, e.g. that you can easily change semantics from transaction to synch_transaction, if stress test indicate that you get better characteristics that way. This of course assumes that the access library function wraps the "activity kind" parameter, and doesn't let that leak out of the access API. For a given category of data, you'd probably not want to mix different activity kinds anyway. There are other tricks one can pull with a private access API, for example during tricky upgrades, but that's a whole different story. A matter of programming preferences, perhaps. /Uffe From bjorn@REDACTED Thu Jul 10 16:01:00 2003 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 10 Jul 2003 16:01:00 +0200 Subject: Please test snapshots of the coming R9C In-Reply-To: <200307101327.h6ADRA62018971@harpo.it.uu.se> References: <200307101327.h6ADRA62018971@harpo.it.uu.se> Message-ID: Please check the latest snapshot. The problem has probably been fixed. /Bjorn Mikael Pettersson writes: > On Thu, 10 Jul 2003 10:47:49 +0200 (MEST), Mikael Pettersson wrote: > >On Thu, 10 Jul 2003 09:25:33 +0300, Per Bergqvist wrote: > >>Hipe doesn't build properly with the 07-09 snapshot. > >> > >>erlc -W -bbeam +debug_info -o../ebin hipe_tagscheme.erl > >>/home/perber/build/otp_src_P9C_2003-07-09/lib/hipe/rtl/hipe_tagscheme. > >>erl:695: undefined macro ''P_OFF_HEAP_OVERHEAD'' > >>/home/perber/build/otp_src_P9C_2003-07-09/lib/hipe/rtl/hipe_tagscheme. > >>erl:37: function finalize_bin/4 undefined > >>make[1]: *** [../ebin/hipe_tagscheme.beam] Error 1 > > > >It seems you configured for shared heap; it builds Ok > >in the default private heap configuration. > > My mistake -- make completed the build but I forgot that make > doesn't halt on errors under lib/ on Linux/RH9 for some reason, > and your error did indeed occur in lib/hipe/. > > The problem is that somehow shared-heap gets enabled by default, > but the HiPE compiler currently breaks in that configuration. > I'll have a look at the configuration problem later today. > > /Mikael > -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From fredrik.linder@REDACTED Thu Jul 10 16:01:24 2003 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Thu, 10 Jul 2003 16:01:24 +0200 Subject: Contribution to the record- and write-your-own-guards debates In-Reply-To: Message-ID: > From: Luke Gorrie [mailto:luke@REDACTED] > > "Fredrik Linder" writes: > > > I often find myself forced to unnecessary nesting in my code > due to the fact > > that I am disallowed to write my own guards. > > > > I usually write ADTs to conceil my data bearers, which is a > practis I find > > very good since it nicely divides my code into good working bricks. But > > since I am disallowed to write my own guard-functions I cannot match > > directly on those ADTs, but have to explicitly extract the > information and > > then match on these values instead. > > This particular problem could be helped by the rumoured "cond" > construct. It's like 'if', but uses arbitrary expressions for the > tests instead of more restricted guard expressions. > > I reckon 'cond' would/will be very nice :-) The 'cond' construct would indeed be very nice to have. And to some extent it would lessen the nesting. However, I would still not be able to select on a function-clause level which I sometimes find desireable. A 'cond' construct would definitely be a step in the right direction though. :-) Sincerely /Fredrik From bjorn@REDACTED Thu Jul 10 16:34:28 2003 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 10 Jul 2003 16:34:28 +0200 Subject: Please test snapshots of the coming R9C In-Reply-To: <440A2703A54A8F4FB2AC2AE34F27129D215AD1@ESEALNT889.al.sw.ericsson.se> References: <440A2703A54A8F4FB2AC2AE34F27129D215AD1@ESEALNT889.al.sw.ericsson.se> Message-ID: I'll try to include your erl_tar patch in R9C. /Bjorn "Erik Reitsma (RY/ETM)" writes: > Hi, > > > It is now less than a month to the R9C release. The code is frozen but > > we are still doing some testing, adding some missing documentation and > > release notes. > > I looked at the code and it seems that my ASN.1 patch for ObjectDescriptor (replacing 'OBJECT_DESCRIPTOR' with 'ObjectDescriptor' in all erlang source) and my erl_tar patch (use the magic 'ustar\0', fixing problems with paths > 100 bytes when untarring with other tar tools) have not yet been included. That is unfortunate, since it means that I will have to patch R9C as I had to patch R9B-1. > > *Erik. > -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From rickard.green@REDACTED Thu Jul 10 16:59:28 2003 From: rickard.green@REDACTED (Rickard Green) Date: Thu, 10 Jul 2003 16:59:28 +0200 Subject: Please test snapshots of the coming R9C References: <200307101327.h6ADRA62018971@harpo.it.uu.se> Message-ID: <3F0D7F50.1040202@uab.ericsson.se> This is fixed in the next snapshot. Both a separate heap emulator and a shared heap emulator are now built. The shared heap emulator is started by passing erl the -shared command line argument. If hipe has been enabled, the shared heap emulator will not be able to run native compiled code though. (This since the hipe application use hipe_mkliterals compiled for the separate heap emulator.) Regards, Rickard Green, Erlang/OTP Mikael Pettersson wrote: > On Thu, 10 Jul 2003 10:47:49 +0200 (MEST), Mikael Pettersson wrote: > >>On Thu, 10 Jul 2003 09:25:33 +0300, Per Bergqvist wrote: >> >>>Hipe doesn't build properly with the 07-09 snapshot. >>> >>>erlc -W -bbeam +debug_info -o../ebin hipe_tagscheme.erl >>>/home/perber/build/otp_src_P9C_2003-07-09/lib/hipe/rtl/hipe_tagscheme. >>>erl:695: undefined macro ''P_OFF_HEAP_OVERHEAD'' >>>/home/perber/build/otp_src_P9C_2003-07-09/lib/hipe/rtl/hipe_tagscheme. >>>erl:37: function finalize_bin/4 undefined >>>make[1]: *** [../ebin/hipe_tagscheme.beam] Error 1 >> >>It seems you configured for shared heap; it builds Ok >>in the default private heap configuration. > > > My mistake -- make completed the build but I forgot that make > doesn't halt on errors under lib/ on Linux/RH9 for some reason, > and your error did indeed occur in lib/hipe/. > > The problem is that somehow shared-heap gets enabled by default, > but the HiPE compiler currently breaks in that configuration. > I'll have a look at the configuration problem later today. > > /Mikael > From Marc.Vanwoerkom@REDACTED Thu Jul 10 19:09:54 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Thu, 10 Jul 2003 19:09:54 +0200 (MEST) Subject: BSD Firewall (long) In-Reply-To: <4.2.2.20030709220455.00d01220@duomark.com> (message from Jay Nelson on Wed, 09 Jul 2003 22:46:12 -0700) Message-ID: <200307101709.h6AH9s523547@bonsai.fernuni-hagen.de> > Thanks for all the tips. I got set up with OpenBSD. I chose > it because the security seemed to be its strongest point > and the tutorials were as good as those I found on the other > variants. Security is their main topic. But this doesn't mean that the other BSDs are much weaker, important bug fixes and good new innovations travel fast among the BSDs. There are many developers with access to two project trees, who do this syncing. > Don't get me wrong, I like Linux as a desktop and development > environment. There is no Linux specific desktop software, except for some games, which still runder the BSD kernel module (it is not a real emulator, rather a different mode, because the BSD kernel executes linux syscalls and uses linux libs). IMHO hardware drivers make the difference. >From the desktop side, evrything available for Linux should be reproducible for BSD. But while for Linux you can buy ready made very userfriendly distributions, for BSD nobody cared to do so far. But that is lack of interest, perhaps lack of man power, but not technically caused. Regards, Marc From Marc.Vanwoerkom@REDACTED Thu Jul 10 20:08:22 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Thu, 10 Jul 2003 20:08:22 +0200 (MEST) Subject: Is it a list ? In-Reply-To: <3F0D6063.2020806@web.de> (message from Joachim Durchholz on Thu, 10 Jul 2003 14:47:31 +0200) Message-ID: <200307101808.h6AI8M900194@bonsai.fernuni-hagen.de> > Conjecture: I assume you meant to write [1, 2], which will give a > well-formed list of the two numbers 1 and 2 :-) Or [1|[2]] .. But why is is_list([1|2]) true? Or asked differently, is there a legitimate use for ill-formed lists? Regards, Marc From luke@REDACTED Thu Jul 10 20:08:03 2003 From: luke@REDACTED (Luke Gorrie) Date: 10 Jul 2003 20:08:03 +0200 Subject: BSD Firewall (long) In-Reply-To: <4.2.2.20030709220455.00d01220@duomark.com> References: <4.2.2.20030709220455.00d01220@duomark.com> Message-ID: Jay Nelson writes: > Everything is very similar to Linux in terms of administration > (I've used System V, Solaris, Linux and other variants, so at > least a lot of the utilities are familiar). I really like the NAT / > packet filtering features offered by pf. ipchains may be very > similar, but I've never gotten good tutorials on how to use it > so I can't tell. ipchains has been superceded by iptables in 2.4 kernels. iptables is monsterously powerful -- we spend about as much time hacking iptables as Erlang around here it seems. The iptables documentation is also very good. You can find it at http://www.netfilter.org/ if you're curious. Cheers, Luke From joachim.durchholz@REDACTED Thu Jul 10 20:19:25 2003 From: joachim.durchholz@REDACTED (Joachim Durchholz) Date: Thu, 10 Jul 2003 20:19:25 +0200 Subject: Is it a list ? In-Reply-To: <200307101808.h6AI8M900194@bonsai.fernuni-hagen.de> References: <200307101808.h6AI8M900194@bonsai.fernuni-hagen.de> Message-ID: <3F0DAE2D.7040109@web.de> Marc Ernst Eddy van Woerkom wrote: >> Conjecture: I assume you meant to write [1, 2], which will give a >> well-formed list of the two numbers 1 and 2 :-) > > Or [1|[2]] .. Which is the same. > But why is is_list([1|2]) true? Because checking the well-formedness of lists would entail O(N) overhead, since is_list would have to scan all elements of the list's spine. > Or asked differently, is there a legitimate use for ill-formed lists? To a large extent, the question of "legitimate use" is one of tradition and experience: things that have proved to have unfortunate consequences tend to be called illegitimate by later generations. In practice, what's legitimate is what the language and environment make easy to use. In this sense, the OTP routines say no. Crashing when being given an ill-formed list is a very clear and loud way of saying No :-). On the other hand, the language says yes - otherwise executing [1|2] would crash immediately. So I don't know whether it's legitimate or not. Personally, I'd avoid using ill-formed lists. In addition, I'd recommend that Erlang crashed if the object on the right-hand side of | were not a list, so that ill-formed lists cannot be constructed. But that's just my personal tradition and experience :-) Regards, Jo From luke@REDACTED Thu Jul 10 20:33:50 2003 From: luke@REDACTED (Luke Gorrie) Date: 10 Jul 2003 20:33:50 +0200 Subject: Is it a list ? In-Reply-To: <200307101808.h6AI8M900194@bonsai.fernuni-hagen.de> References: <200307101808.h6AI8M900194@bonsai.fernuni-hagen.de> Message-ID: Marc Ernst Eddy van Woerkom writes: > > Conjecture: I assume you meant to write [1, 2], which will give a > > well-formed list of the two numbers 1 and 2 :-) > > Or [1|[2]] .. > > But why is is_list([1|2]) true? Probably because a proper test would mean traversing all the way to the end, which could be expensive. Instead, it's common in Lispy languages to define a 'list' as "either a cons or null/[]", and to treat the "properly" null-terminated list as a different, informal type. > Or asked differently, is there a legitimate use for ill-formed lists? [1|2] takes up less memory (two numbers, one cons cell) than [1,2] (really [1|[2|[]]] - two numbers, two cons cells, and [].) {1,2} also uses more space than [1|2] since it needs to record the length. The 'digraph' module of stdlib represents edges as ['$e'|UniqueNumber] for this memory efficiency. These "improper" lists are also an excellent way to break other languages' implementations of the Erlang external term format. IIRC, JInterface wants to map Erlang lists onto Java's array-based List/Vector types, but you can't map an improper list onto those. That can cause troubles when you accidentally pass improper lists around (e.g. 'catch' can return them.) Cheers, Luke From joachim.durchholz@REDACTED Thu Jul 10 20:41:37 2003 From: joachim.durchholz@REDACTED (Joachim Durchholz) Date: Thu, 10 Jul 2003 20:41:37 +0200 Subject: Please test snapshots of the coming R9C In-Reply-To: References: Message-ID: <3F0DB361.8070205@web.de> Kent Boortz wrote: > Note that in R9C you can build the Windows binary from source. > You need Microsoft Visual C++ and some free tools like Cygwin. > The Windows build instructions are in "$SRCROOT/README.win32". Will there be a version that compiles just with Cygwin? (And, preferrably, emits code that uses mingw32, i.e. doesn't use the cygwin DLL...) Hmm... 12 MB tarball each time there's a new version... having a web interface that allowed downloading just the diffs would definitely be an improvement. Regards, Jo From cpressey@REDACTED Thu Jul 10 20:53:51 2003 From: cpressey@REDACTED (Chris Pressey) Date: Thu, 10 Jul 2003 13:53:51 -0500 Subject: Is it a list ? In-Reply-To: <3F0DAE2D.7040109@web.de> References: <200307101808.h6AI8M900194@bonsai.fernuni-hagen.de> <3F0DAE2D.7040109@web.de> Message-ID: <20030710135351.1d29624f.cpressey@catseye.mb.ca> On Thu, 10 Jul 2003 20:19:25 +0200 Joachim Durchholz wrote: > > Or asked differently, is there a legitimate use for ill-formed > > lists? Section 2.6.2 of the "Erlang Extensions since 4.4" document gives one such use: 2.6.2 Infinite Lists The idea is to write something like: -module(lazy). -export([ints_from/1]). ints_from(N) -> fun() -> [N|ints_from(N+1)] end. Then we can proceed as follows: 24> XX = lazy:ints_from(1). #Fun 25> XX(). [1|#Fun] 26> hd(XX()). 1 27> Y = tl(XX()). #Fun 28> hd(Y()). 2 etc. - this is an example of "lazy embedding" -Chris From anders@REDACTED Thu Jul 10 21:12:14 2003 From: anders@REDACTED (Anders Ramsell) Date: Thu, 10 Jul 2003 21:12:14 +0200 Subject: Contribution to the record- and write-your-own-guards debates In-Reply-To: References: Message-ID: <3F0DBA8E.40709@theheartofgold.org> Fredrik Linder wrote: > > I so would have loved to see that field value restrictions was a part of the > record declaration. But then again, records are tuples (I know, but I guess > that's how most of us view them), and hence "not possible". > > What I really would like to see is a new kind of data container, similiar to > records, with at least the following properties: > > o Named fields (atom names only) > o Field value restriction (to be checked at assignment in run-time) > o Non-destructable (as with all other types) > o Generic field accessors (to be used as guards) > o No default values (don't mix declaration with definition) > o Un-ordered fields (field order is of absolutely no interest) > There is one thing I have been missing in the ongoing debate of replacing/complementing records with a new and "better" construct. This may be because most people find it too obvious to mention. I think it's worth mentioning. To me what makes records great (I think they are) is that they can be inserted into ETS and DETS tables. Without this functionality records would only be useful. If "structs" or whatever they may be called would have to be wrapped in records before inserting them into an ETS table and then unwrapped again after extraction that would make coding a lot more tiresome. If that where the case I think I would continue using records instead. In conclusion I would like to add the following to the list of required properties for "structs": - Builtin support in ETS and DETS /Anders From bjarne@REDACTED Thu Jul 10 21:21:27 2003 From: bjarne@REDACTED (=?iso-8859-1?Q?Bjarne_D=E4cker?=) Date: Thu, 10 Jul 2003 21:21:27 +0200 Subject: Is it a list ? References: <3F0D32B6.90503@eth.ericsson.se> <3F0D6063.2020806@web.de> Message-ID: <006201c34719$9421bf60$670969d4@segeltorp> Hello I think that this is a matter of history. Probably very early in Lisp they were more thinking in terms of binary trees ((1 . 2) . (3 . 4)) which in Erlang would be [[1 | 2] | [3 | 4]] and then the idea of lists appeared (1 . (2 . (3 . (4 . nil)))) and a special syntax evolved (1 2 3 4) but the "dotted pair" survived just like in English people say "geese" instead of "gooses". In Lisp you can write (1 2 3 4 . 5) which in Erlang becomes [1, 2, 3, 4 | 5] where the last element is not [] or [5] but, in fact, simply 5. The space saving is negligeable but you could use this to write clever programs that others find difficult to understand. Thus arose the notion of well-formedness. Bjarne From mikpe@REDACTED Thu Jul 10 21:57:13 2003 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 10 Jul 2003 21:57:13 +0200 (MEST) Subject: Please test snapshots of the coming R9C Message-ID: <200307101957.h6AJvDre028070@harpo.it.uu.se> On Thu, 10 Jul 2003 16:59:28 +0200, Rickard Green wrote: >This is fixed in the next snapshot. I've tested the 07-10 snapshot and it works and passes the HiPE test suites on x86. >Both a separate heap emulator and a shared heap emulator are now built. >The shared heap emulator is started by passing erl the -shared command >line argument. If hipe has been enabled, the shared heap emulator will >not be able to run native compiled code though. (This since the hipe >application use hipe_mkliterals compiled for the separate heap emulator.) True. The loader will scream and refuse to load code compiled for "the other" runtime system. /Mikael From hakan.stenholm@REDACTED Thu Jul 10 22:10:34 2003 From: hakan.stenholm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Stenholm?=) Date: Thu, 10 Jul 2003 22:10:34 +0200 Subject: list comprehension bug ? Message-ID: <903122CA-B312-11D7-B369-000393B8AB26@mbox304.swipnet.se> I encountered a odd list comprehension bug (R9B-0, MacOS X 10.2.6): [Pos || map_get(Map,Pos), Pos <- Neighbours]. results in a "variable 'Pos' is unbound" compile error, but changing the order of the generator and predicate makes the compile error go away: [Pos || Pos <- Neighbours, map_get(Map,Pos) ]. NOTE - the full function looks like this: %% return {X,Y} pos list (of neighboring hexes) for currently selected hex neighbours(Map, {X, Y}) -> Neighbours = case even(X) of false -> [{X,Y+1}, {X,Y-1}, {X+1,Y-1}, {X+1,Y}, {X-1,Y-1}, {X-1,Y} ]; true -> [{X,Y+1}, {X,Y-1}, {X+1,Y+1}, {X+1,Y}, {X-1,Y+1}, {X-1,Y} ] end, %% --> variable 'Pos' is unbound %% [Pos || map_get(Map,Pos), Pos <- Neighbours]. [Pos || Pos <- Neighbours, map_get(Map,Pos) ]. From bparsia@REDACTED Thu Jul 10 22:19:48 2003 From: bparsia@REDACTED (Bijan Parsia) Date: Thu, 10 Jul 2003 16:19:48 -0400 (EDT) Subject: Is it a list ? In-Reply-To: <006201c34719$9421bf60$670969d4@segeltorp> Message-ID: On Thu, 10 Jul 2003, Bjarne D?cker wrote: > Hello > > I think that this is a matter of history. I'm skeptical. > Probably very early in Lisp they were > more thinking in terms of binary trees > > ((1 . 2) . (3 . 4)) I strongly doubt it. I mean, yes, cons cells/pairs are for binary trees. > which in Erlang would be > > [[1 | 2] | [3 | 4]] > > and then the idea of lists appeared > > (1 . (2 . (3 . (4 . nil)))) > > and a special syntax evolved > > (1 2 3 4) This http://www8.informatik.uni-erlangen.de/html/lisp/histlit1.html suggests otherwise. (Search for "To accomplish this McCarthy had to find a notation") Binary tree is just one implementation of lists. Cons cells are more generall just lists. > but the "dotted pair" survived just > like in English people say "geese" > instead of "gooses". > > In Lisp you can write > > (1 2 3 4 . 5) > > which in Erlang becomes > > [1, 2, 3, 4 | 5] > > where the last element is not > [] or [5] but, in fact, simply 5. > > The space saving is negligeable > but you could use this to write > clever programs that others > find difficult to understand. Well, they also have some actually reasonable uses. E.g., association lists, see http://www.cs.auc.dk/~normark/prog3-02/html/notes/fu-intr-1-slide-alists.html The space savings is proportional to the length of the alist. And, it's not merely a space optimization for circular lists: http://www.lispworks.com/reference/HyperSpec/Body/14_ab.htm Of course, whether one *should* use them is a different story. One debate: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=gat-0309021628320001%40192.168.1.50&rnum=13&prev=/groups%3Fq%3Ddotted%2Blists%2Bgroup:comp.lang.lisp.*%2Bgroup:comp.lang.lisp.*%2Bgroup:comp.lang.lisp.*%2Bgroup:comp.lang.lisp.*%26hl%3Den%26lr%3D%26ie%3DUTF-8%26group%3Dcomp.lang.lisp.*%26start%3D10%26sa%3DN Another more interesting one: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=gat-2002021351120001%40eglaptop.jpl.nasa.gov&rnum=1&prev=/groups%3Fselm%3Dgat-2002021351120001%2540eglaptop.jpl.nasa.gov Cheers, Bijan Parsia. From Marc.Vanwoerkom@REDACTED Thu Jul 10 22:41:32 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Thu, 10 Jul 2003 22:41:32 +0200 (MEST) Subject: Is it a list ? In-Reply-To: (message from Luke Gorrie on 10 Jul 2003 20:33:50 +0200) Message-ID: <200307102041.h6AKfWp17330@bonsai.fernuni-hagen.de> > > But why is is_list([1|2]) true? > > Probably because a proper test would mean traversing all the way to > the end, which could be expensive. I would prevent that by trying to make it impossible to create inproper lists in the first place. The question is, if this would be possible. > Instead, it's common in Lispy > languages to define a 'list' as "either a cons or null/[]", and to > treat the "properly" null-terminated list as a different, informal > type. In other words: historic tradition > [1|2] takes up less memory (two numbers, one cons cell) than [1,2] > (really [1|[2|[]]] - two numbers, two cons cells, and [].) {1,2} also > uses more space than [1|2] since it needs to record the length. > > The 'digraph' module of stdlib represents edges as ['$e'|UniqueNumber] > for this memory efficiency. I don't like that. What is the sense to use a rather slow but sophisticated high level language (thus hope for correctness) like Erlang and then to resort to optimaztion tricks? > These "improper" lists are also an excellent way to break other > languages' implementations of the Erlang external term format So Erlang can play rude, as well, eh? :) Regards, Marc From Marc.Vanwoerkom@REDACTED Thu Jul 10 22:43:24 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Thu, 10 Jul 2003 22:43:24 +0200 (MEST) Subject: Is it a list ? In-Reply-To: <3F0DAE2D.7040109@web.de> (message from Joachim Durchholz on Thu, 10 Jul 2003 20:19:25 +0200) Message-ID: <200307102043.h6AKhOF17507@bonsai.fernuni-hagen.de> > and experience: things that have proved to have unfortunate consequences > tend to be called illegitimate by later generations. It's old cruft, if I understood you and Luke right. Regards, Marc From Marc.Vanwoerkom@REDACTED Thu Jul 10 22:45:56 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Thu, 10 Jul 2003 22:45:56 +0200 (MEST) Subject: Please test snapshots of the coming R9C In-Reply-To: <3F0DB361.8070205@web.de> (message from Joachim Durchholz on Thu, 10 Jul 2003 20:41:37 +0200) Message-ID: <200307102045.h6AKjut17787@bonsai.fernuni-hagen.de> > Hmm... 12 MB tarball each time there's a new version... having a web > interface that allowed downloading just the diffs would definitely be an > improvement. If they would check in their stuff into cvs and make that available, they would get all that and more for free (e.g. cvsweb). Hint, hint! But manual made diff s would be nice, yes. Regards, Marc From Marc.Vanwoerkom@REDACTED Thu Jul 10 22:49:31 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Thu, 10 Jul 2003 22:49:31 +0200 (MEST) Subject: Is it a list ? In-Reply-To: <20030710135351.1d29624f.cpressey@catseye.mb.ca> (message from Chris Pressey on Thu, 10 Jul 2003 13:53:51 -0500) Message-ID: <200307102049.h6AKnVg18142@bonsai.fernuni-hagen.de> > 2.6.2 Infinite Lists Ah, that rings a bell. I was teached about that idea under the name "streams". On the other hand, I am not too convinced by those lazy evaluation techniques (or too stupid, should reread my functional programming course on that) Regards, Marc From richardc@REDACTED Thu Jul 10 23:12:22 2003 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 10 Jul 2003 23:12:22 +0200 Subject: Is it a list ? References: <200307102041.h6AKfWp17330@bonsai.fernuni-hagen.de> Message-ID: <004901c34727$f75c3de0$51ddd1d9@gnit> ----- Original Message ----- From: "Marc Ernst Eddy van Woerkom" To: > > > But why is is_list([1|2]) true? > > > > Probably because a proper test would mean traversing all the way to > > the end, which could be expensive. > > I would prevent that by trying to make it impossible to > create inproper lists in the first place. > The question is, if this would be possible. Possible, yes (although it would break some existing code, of course) but it would also be expensive. For each new cons cell created, you would get a test-and-branch. It is simply much more convenient to allow any term in the second argument, and let the users decide how to use the cons cells - for proper lists only, or for tree-like structures as well. In Erlang programs, you don't see non-proper lists being used often. Of course the 'is_list' test could have been given the more correct name 'is_nil_or_cons_cell', but when you've typed that enough times, you tend to say "screw correctness, I want a shorter name for this thing!". And generally you do not want to traverse the whole list for each test, so making 'is_list' only yield true for proper lists is not a good solution either. /Richard From luke@REDACTED Thu Jul 10 23:21:22 2003 From: luke@REDACTED (Luke Gorrie) Date: 10 Jul 2003 23:21:22 +0200 Subject: Is it a list ? In-Reply-To: <200307102043.h6AKhOF17507@bonsai.fernuni-hagen.de> References: <200307102043.h6AKhOF17507@bonsai.fernuni-hagen.de> Message-ID: Marc Ernst Eddy van Woerkom writes: > > and experience: things that have proved to have unfortunate consequences > > tend to be called illegitimate by later generations. > > It's old cruft, if I understood you and Luke right. Before drawing conclusions, there are some interesting uses of improper* lists that are fun to consider. We all know Erlang's pattern matching, like [A,B,C] = [1,2,3]. But suppose you want to match patterns that are created at runtime, by writing an interpreter for pattern matching instead. The pattern interpreter takes a data structure representing a pattern and a term to match it with, and returns a list of variable bindings (if it matches successfully) or the atom 'nomatch'. Consider a simple form of pattern -- any atom is a variable, lists are matched recursively, and anything else has to match by value. Examples: match(['A','B','C'], [1,2,3]) => [{A,1},{B,2},{C,3}] match(12345, 12345) => [] match(['A','B','C'], foo) => nomatch Here comes a simple implementation. It will recurse down lists, match variables with values (if used multiple times, the values must agree), and match anything else by value. match(Pattern, Object) -> match(Pattern, Object, []). %% match(Pattern, Object, Bindings) => Bindings' | nomatch match([P|Ps], [X|Xs], Bs) -> % matching a list.. match(Ps, Xs, match(P, X, Bs)); match(_, _, nomatch) -> %% This tricky clause is to handle the previous one's recursion -- %% it will pass 'nomatch' instead of a bindings list if the first %% element of a list doesn't match! nomatch; match(P, X, Bs) when atom(P) -> % matching a variable.. case lists:keysearch(P, 1, Bs) of % is it bound? false -> [{P,X}|Bs]; % no -- create binding {value, {P, X}} -> Bs; % yes -- existing binding matches {value, {P, _}} -> nomatch % yes -- incompatible binding! end; match(X, X, Bs) -> % successful match of a constant.. Bs; match(_, _, _) -> % failure! nomatch. Cute function I think! I knocked it off from the Lisp literature. Now, suppose you wanted to extend the pattern matcher to handle patterns like [A,B|C]. How would you do it? (Drum roll..) it already works! match(['A','B'|'C'], [1,2,3,4,5]) -> [{'A',1},{'B',2},{'C',[3,4,5]}] But... how would you code this if you couldn't use improper lists to represent patterns? NB: At a glance, it looks like the shell's erlang interpreter (erl_eval) works basically like this. NB2: I cheated in the examples above -- the function actually returns bindings in "reverse" order. [*]: I think there's a more neutral name for "improper" lists. Anyone know it? Cheers, Luke From joachim.durchholz@REDACTED Thu Jul 10 23:32:20 2003 From: joachim.durchholz@REDACTED (Joachim Durchholz) Date: Thu, 10 Jul 2003 23:32:20 +0200 Subject: Please test snapshots of the coming R9C In-Reply-To: <200307102045.h6AKjut17787@bonsai.fernuni-hagen.de> References: <200307102045.h6AKjut17787@bonsai.fernuni-hagen.de> Message-ID: <3F0DDB64.40701@web.de> Marc Ernst Eddy van Woerkom wrote: > If they would check in their stuff into cvs and > make that available, they would get all that and > more for free (e.g. cvsweb). > > Hint, hint! Forget it - as noted by somebody earlier, Ericsson is already using a version management system, and it's not CVS. (And don't try to persuade them to convert to CVS - large companies aren't going to reverse decisions just because some outsiders would like things different.) Anyway, there's one thing that I'd like to see, and that should not place an undue burden on the Erlang team at Ericsson: Somebody (maybe at Ericsson, maybe elsewhere) sets up a CVS server, providing read access for everybody, write access just for the Erlang team. Whenever a new revision of Open Source Erlang is ready, the Erlang team creates a clean source tree (just like for the tarball), then checks it in with the CVS server. This will not preserve the revision tags, but it will allow people to see what has changed, and it will allow them to do incremental updates. Just a proposal :-) Regards, Jo From luke@REDACTED Thu Jul 10 23:33:26 2003 From: luke@REDACTED (Luke Gorrie) Date: 10 Jul 2003 23:33:26 +0200 Subject: Is it a list ? In-Reply-To: References: <200307102043.h6AKhOF17507@bonsai.fernuni-hagen.de> Message-ID: Luke Gorrie writes: > match(Pattern, Object) -> match(Pattern, Object, []). > > %% match(Pattern, Object, Bindings) => Bindings' | nomatch > match([P|Ps], [X|Xs], Bs) -> % matching a list.. > match(Ps, Xs, match(P, X, Bs)); > match(_, _, nomatch) -> > %% This tricky clause is to handle the previous one's recursion -- > %% it will pass 'nomatch' instead of a bindings list if the first > %% element of a list doesn't match! > nomatch; > match(P, X, Bs) when atom(P) -> % matching a variable.. > case lists:keysearch(P, 1, Bs) of % is it bound? > false -> [{P,X}|Bs]; % no -- create binding > {value, {P, X}} -> Bs; % yes -- existing binding matches > {value, {P, _}} -> nomatch % yes -- incompatible binding! > end; > match(X, X, Bs) -> % successful match of a constant.. > Bs; > match(_, _, _) -> % failure! > nomatch. Actually, this one is cuter, if a bit less "software engineered": match(Pattern, Object) -> case catch match(Pattern, Object, []) of {'EXIT', _} -> nomatch; Bindings -> lists:reverse(Bindings) end. match([P|Ps], [X|Xs], Bs) -> match(Ps, Xs, match(P, X, Bs)); match(P, X, Bs) when atom(P) -> case lists:keysearch(P, 1, Bs) of false -> [{P,X}|Bs]; {value, {P, X}} -> Bs end; match(X, X, Bs) -> Bs. NB: http://www-csli.stanford.edu/~john/procrastination.html Cheers, Luke From erlang@REDACTED Thu Jul 10 18:48:47 2003 From: erlang@REDACTED (Inswitch Solutions - Erlang Evaluation) Date: Thu, 10 Jul 2003 18:48:47 +0200 Subject: Is it a list ? & atoms defined References: <200307102041.h6AKfWp17330@bonsai.fernuni-hagen.de> <004901c34727$f75c3de0$51ddd1d9@gnit> Message-ID: <006f01c34703$23109870$1e00a8c0@design> The same happens with list_to_atom([1-2]). is_list[1-2] = true Please, does someone know how to list the atoms already defined in the runtime ? The file created when ERTS crash (crash-dump) dumps all the atoms defined. /Eduardo ----- Original Message ----- From: "Richard Carlsson" To: "Marc Ernst Eddy van Woerkom" Cc: Sent: Thursday, July 10, 2003 11:12 PM Subject: Re: Is it a list ? > ----- Original Message ----- > From: "Marc Ernst Eddy van Woerkom" > To: > > > > > > But why is is_list([1|2]) true? > > > > > > Probably because a proper test would mean traversing all the way to > > > the end, which could be expensive. > > > > I would prevent that by trying to make it impossible to > > create inproper lists in the first place. > > The question is, if this would be possible. > > Possible, yes (although it would break some existing code, of course) > but it would also be expensive. For each new cons cell created, > you would get a test-and-branch. It is simply much more convenient > to allow any term in the second argument, and let the users decide > how to use the cons cells - for proper lists only, or for tree-like > structures as well. In Erlang programs, you don't see non-proper > lists being used often. > > Of course the 'is_list' test could have been given the more correct name > 'is_nil_or_cons_cell', but when you've typed that enough times, you tend > to say "screw correctness, I want a shorter name for this thing!". And > generally you do not want to traverse the whole list for each test, so > making 'is_list' only yield true for proper lists is not a good solution > either. > > /Richard > From kent@REDACTED Fri Jul 11 00:01:10 2003 From: kent@REDACTED (Kent Boortz) Date: 11 Jul 2003 00:01:10 +0200 Subject: Please test snapshots of the coming R9C In-Reply-To: <3F0DB361.8070205@web.de> References: <3F0DB361.8070205@web.de> Message-ID: Joachim Durchholz writes: > > Note that in R9C you can build the Windows binary from source. > > You need Microsoft Visual C++ and some free tools like Cygwin. > > The Windows build instructions are in "$SRCROOT/README.win32". > > Will there be a version that compiles just with Cygwin? > (And, preferrably, emits code that uses mingw32, i.e. doesn't use the > cygwin DLL...) I was not clear, the resulting binary is a true windows application, not a Cygwin application. The cygwin DLL is not used in by the resulting Erlang application. Adding support for using mingw32 instead of Visual C++ is a task for the Erlang OpenSource community I think ;-) kent From rprice@REDACTED Thu Jul 10 00:11:34 2003 From: rprice@REDACTED (Roger Price) Date: Thu, 10 Jul 2003 00:11:34 +0200 (CEST) Subject: What decides the name of a module? In-Reply-To: <16135.52922.230566.797339@antilipe.corelatus.se> Message-ID: On Sun, 6 Jul 2003, Matthias Lang wrote: > 1> c(rabbit). > ** Module name 'roger' does not match file name 'rabbit' ** > {error,badfile} > :-) Hello Matthias, This is exactly what I was thinking of. I very rarely use c/1, almost always erlc or compile:file, so I've never seen this message :-( I still think it would be helpful if erlc and compile:file as well as c/1 issued the ** Module name... ** message. Best Regards, Roger From Marc.Vanwoerkom@REDACTED Fri Jul 11 01:03:51 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Fri, 11 Jul 2003 01:03:51 +0200 (MEST) Subject: Is it a list ? In-Reply-To: <004901c34727$f75c3de0$51ddd1d9@gnit> (richardc@csd.uu.se) Message-ID: <200307102303.h6AN3pY00317@bonsai.fernuni-hagen.de> > Of course the 'is_list' test could have been given the more correct name > 'is_nil_or_cons_cell', but when you've typed that enough times, you tend > to say "screw correctness, I want a shorter name for this thing!". This made me curious. I just wanted to look up the definition of is_list/1. Where am I supposed to find the authorative documentation? E.g. I had a look on the man page which lists some BIFs (using erl -man erlang), but I found nothing here. Regards, Marc From Marc.Vanwoerkom@REDACTED Fri Jul 11 01:20:03 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Fri, 11 Jul 2003 01:20:03 +0200 (MEST) Subject: Is it a list ? & atoms defined In-Reply-To: <006f01c34703$23109870$1e00a8c0@design> (erlang@inswitch.us) Message-ID: <200307102320.h6ANK3A20963@bonsai.fernuni-hagen.de> > list_to_atom([1-2]). > > is_list[1-2] = true [1-2] = [-1] looks ok to me. Regards, Marc From lennart.ohman@REDACTED Fri Jul 11 08:06:52 2003 From: lennart.ohman@REDACTED (=?ISO-8859-1?Q?Lennart_=D6hman?=) Date: Fri, 11 Jul 2003 08:06:52 +0200 Subject: Is it a list ? References: <200307102303.h6AN3pY00317@bonsai.fernuni-hagen.de> Message-ID: <3F0E53FC.5040107@st.se> Hi, this is part of the "Erlang extensions since 4.4". It is a long story why it is called extensions and not simply additions to the language. The extensions are typically things added after the 2nd edition of the Erlang book was written. You find it in http://www.erlang.org/doc/r9b/doc/extensions/part_frame.html chapter 7. /Lennart Marc Ernst Eddy van Woerkom wrote: >> Of course the 'is_list' test could have been given the more correct name >> 'is_nil_or_cons_cell', but when you've typed that enough times, you tend >> to say "screw correctness, I want a shorter name for this thing!". > > > This made me curious. I just wanted to look up the definition of is_list/1. > Where am I supposed to find the authorative documentation? > > E.g. I had a look on the man page which lists some BIFs (using erl -man erlang), > but I found nothing here. > > Regards, > Marc > > > > -- ------------------------------------------------------------- Lennart Ohman phone : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 6735 Sehlstedtsgatan 6 fax : +46-8-667 8230 SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED From matthias@REDACTED Fri Jul 11 09:45:38 2003 From: matthias@REDACTED (Matthias Lang) Date: Fri, 11 Jul 2003 09:45:38 +0200 Subject: snapshot 2003-07-10 Message-ID: <16142.27426.962546.49698@antilipe.corelatus.se> Compiled mostly fine on my box (x86, debian "testing"). One slight hiccup: make[4]: Entering directory `/usr/local/src/otp_src_P9C_2003-07-10/lib/orber/c_src' mkdir -p ../priv/obj/i686-pc-linux-gnu mkdir -p ../priv/bin/i686-pc-linux-gnu gcc -c -o ../priv/obj/i686-pc-linux-gnu/obj_init_port.o -g -O2 -I/usr/local/src/otp_src_P9C_2003-07-10/erts/i686-pc-linux-gnu -DHAVE_CONFIG_H obj_init_port.c In file included from obj_init_port.c:23: inet.h:39:8: warning: extra tokens at end of #endif directive gcc -c -o ../priv/obj/i686-pc-linux-gnu/setsockaddr_in.o -g -O2 -I/usr/local/src/otp_src_P9C_2003-07-10/erts/i686-pc-linux-gnu -DHAVE_CONFIG_H setsockaddr_in.c In file included from setsockaddr_in.c:20: inet.h:39:8: warning: extra tokens at end of #endif directive gcc -o ../priv/bin/i686-pc-linux-gnu/obj_init_port ../priv/obj/i686-pc-linux-gnu/obj_init_port.o ../priv/obj/i686-pc-linux-gnu/setsockaddr_in.o -lncurses -lresolv -ldl -lm c++ -c -o ../priv/obj/i686-pc-linux-gnu/InitialReference.o -DHAVE_CONFIG_H InitialReference.cc In file included from InitialReference.cc:26: InitialReference.hh:28:23: strstream.h: No such file or directory In file included from InitialReference.cc:26: This doesn't stop the emulator from working, but maybe it stops Orber from working. I don't know, I don't use Orber. Anyway: - It might help some people if the README mentioned that you need a C++ compiler if you want Orber built. - I think g++ can't find strstream.h because the GNU folks have moved the header out of the way because the C++ standard deprecated that header last century ;-). It works ok if I give it the path there, but that's just a hack. Matthias From thomasl_erlang@REDACTED Fri Jul 11 10:14:45 2003 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 11 Jul 2003 01:14:45 -0700 (PDT) Subject: list comprehension bug ? In-Reply-To: <903122CA-B312-11D7-B369-000393B8AB26@mbox304.swipnet.se> Message-ID: <20030711081445.58523.qmail@web41905.mail.yahoo.com> --- H?kan_Stenholm wrote: > I encountered a odd list comprehension bug (R9B-0, > MacOS X 10.2.6): > > [Pos || map_get(Map,Pos), Pos <- Neighbours]. > > results in a "variable 'Pos' is unbound" compile > error, but changing > the order of the generator and predicate makes the > compile error go > away: > > [Pos || Pos <- Neighbours, map_get(Map,Pos) ]. The generators/filters sequence of a list comprehension is evaluated left to right, so the compiler behaviour is correct. The documentation is a bit unclear on this point, so it's a natural mistake to make: (http://www.erlang.org/doc/r9b/doc/extensions/part_frame.html section 3.2) "The scope rules for variables which occur in list comprehensions are as follows: * all variables which occur in a generator pattern are assumed to be "fresh" variables * any variables which are defined before the list comprehension and which are used in filters have the values they had before the list comprehension * no variables may be exported from a list comprehension." Thus, your first example might be interpreted to be correct using those rules, since nothing says the "fresh" variable Pos is only visible "to the right" of the generator. In the same vein, we can also write the unintuitive: % example 1 > Y = [["abc", "def", "ghi"]], X = [["123", "456"], ["789"]], [ X || X <- X, Y <- X, X <- Y ]. or even % example 2 > X = [["123", "456"], ["789"]], [ X || X <- X, X <- X, X <- X ]. which actually work. But without a left-to-right evaluation order, it's not so clear what should happen. Example 1 could yield two different results, depending on evaluation order (try reversing the order of the generators). The examples in the documentation do imply a left-to-right evaluation order and scoping, and it is the "standard" way to define list comprehensions. But it should of course be documented explicitly. Best, Thomas __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From per@REDACTED Fri Jul 11 09:34:38 2003 From: per@REDACTED (Per Bergqvist) Date: Fri, 11 Jul 2003 10:34:38 +0300 Subject: snapshot 2003-07-10 In-Reply-To: <16142.27426.962546.49698@antilipe.corelatus.se> Message-ID: <200307110834.h6B8Ycd26966@tessla.levonline.com> ------------------- > > - I think g++ can't find strstream.h because the GNU folks have > moved the header out of the way because the C++ standard > deprecated that header last century ;-). It works ok if I > give it the path there, but that's just a hack. > Yes, it has been deprecated for a long time, in gcc 3.3 it is completely removed. InitialReference should be fixed to use sstream instead. (It is probably trivial but it is S.E.P. I've had to hack to much c++ during the last year for living and will not do it for fun ;-) /Per > Matthias > ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From joachim.durchholz@REDACTED Fri Jul 11 10:50:46 2003 From: joachim.durchholz@REDACTED (Joachim Durchholz) Date: Fri, 11 Jul 2003 10:50:46 +0200 Subject: Please test snapshots of the coming R9C In-Reply-To: References: <3F0DB361.8070205@web.de> Message-ID: <3F0E7A66.5010607@web.de> Kent Boortz wrote: > Joachim Durchholz writes: > >>>Note that in R9C you can build the Windows binary from source. >>>You need Microsoft Visual C++ and some free tools like Cygwin. >>>The Windows build instructions are in "$SRCROOT/README.win32". >> >>Will there be a version that compiles just with Cygwin? >>(And, preferrably, emits code that uses mingw32, i.e. doesn't use the >>cygwin DLL...) > > I was not clear, the resulting binary is a true windows application, > not a Cygwin application. The cygwin DLL is not used in by the > resulting Erlang application. Actually I didn't expect that - MSVC++ doesn't emit code that relies on Cygwin :-) > Adding support for using mingw32 instead of Visual C++ is a task for > the Erlang OpenSource community I think ;-) Ah well... I'll have to try it out. Regards, Jo From vlad_dumitrescu@REDACTED Fri Jul 11 11:36:13 2003 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 11 Jul 2003 11:36:13 +0200 Subject: P9C Message-ID: Hi again, I finally downloaded, but it seems that the archives (both _10 and _11) are gzipped twice: the .tar file resulted from gzipping once is still in .gz format. If using "tar zxf" on it, all is fine. But I can't find any README.win32 in them anyways... :-( regards, Vlad From per@REDACTED Fri Jul 11 10:44:11 2003 From: per@REDACTED (Per Bergqvist) Date: Fri, 11 Jul 2003 11:44:11 +0300 Subject: snapshot 2003-07-10 In-Reply-To: <200307110834.h6B8Ycd26966@tessla.levonline.com> Message-ID: <200307110944.h6B9iBP28485@tessla.levonline.com> Changed my mind and fixed the orber c++ prob as well when fixing some other stuff to get better gcc 3.3 support. The orber fix is completely untested. Can somebody please test it. At least it compiles ;-) Attached is a patch relative 2003-07-10 snapshot to fix support for gcc 3.3. It mainly removes warnings but also fix building of ssl and orber. To apply: 1) cd $ERL_TOP 2) patch -p1 < patch_file 3) cd $ERL_TOP/erts 4) autoconf 5) cd $ERLT_TOP/lib/erl_interface 6) autoconf 7) cd $ERL_TOP 8) ./configure ... /Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED -------------- next part -------------- A non-text attachment was scrubbed... Name: otp_src_P9C_2003-07-10.patch Type: application/octet-stream Size: 11789 bytes Desc: not available URL: From sean.hinde@REDACTED Fri Jul 11 14:20:24 2003 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 11 Jul 2003 13:20:24 +0100 Subject: Please test snapshots of the coming R9C In-Reply-To: Message-ID: <0C540D19-B39A-11D7-9CA4-000A95927CCE@mac.com> On Wednesday, July 9, 2003, at 05:12 pm, Kent Boortz wrote: > > It is now less than a month to the R9C release. The code is frozen but > we are still doing some testing, adding some missing documentation and > release notes. > The compile of the asn1 driver under OS X still tries to use ld for the final link stage resulting in: dyld: /Users/sean/R9C-0/lib/erlang/erts-2003.07.11/bin/beam Undefined symbols: dyld_stub_binding_helper Trace/BPT trap and an emulator crash when calling asn1rt:load-driver(). The fix is to use gcc for the final link stage. The same problem exists in trace_ip_drv and trace_file_drv. megaco_flex_scanner DOES work :) Sean From matthias@REDACTED Fri Jul 11 15:18:16 2003 From: matthias@REDACTED (Matthias Lang) Date: Fri, 11 Jul 2003 15:18:16 +0200 Subject: snapshot 2003-07-10 In-Reply-To: <200307110944.h6B9iBP28485@tessla.levonline.com> References: <200307110834.h6B8Ycd26966@tessla.levonline.com> <200307110944.h6B9iBP28485@tessla.levonline.com> Message-ID: <16142.47384.625001.123379@antilipe.corelatus.se> Per Bergqvist writes: > The orber fix is completely untested. Can somebody please test it. > At least it compiles ;-) > > Attached is a patch relative 2003-07-10 snapshot to fix support for > gcc 3.3. It mainly removes warnings but also fix building of ssl and > orber. Once I actually followed instructions and re-ran autoconf, your patch compiled just fine. I don't use Orber, so I can't (easily) test whether it also works. Maybe someone else can... Matthias From vlad_dumitrescu@REDACTED Fri Jul 11 22:25:43 2003 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 11 Jul 2003 22:25:43 +0200 Subject: P9C References: Message-ID: Sorry, I noticed my original post didn't make it to the list... I think everything except the missing README.win32 file can be safely ignored :-) I can't wait to get back from vacation to see what's new! regards, Vlad ----- Original Message ----- From: "Vlad Dumitrescu" To: Sent: Friday, July 11, 2003 11:36 AM Subject: P9C > Hi again, > > I finally downloaded, but it seems that the archives (both _10 and _11) are > gzipped twice: the .tar file resulted from gzipping once is still in .gz > format. If using "tar zxf" on it, all is fine. > > But I can't find any README.win32 in them anyways... :-( > > regards, > Vlad > From vlad_dumitrescu@REDACTED Fri Jul 11 11:00:22 2003 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 11 Jul 2003 11:00:22 +0200 Subject: Please test snapshots of the coming R9C References: <3F0DB361.8070205@web.de> Message-ID: ----- Original Message ----- From: "Kent Boortz" > I was not clear, the resulting binary is a true windows application, > not a Cygwin application. The cygwin DLL is not used in by the > resulting Erlang application. > > Adding support for using mingw32 instead of Visual C++ is a task for > the Erlang OpenSource community I think ;-) Hi, I've just returned from the first half of my vacation and to my delight I found the R9C snapshots... Great!!! Too bad I am leaving again tomorrow... One question: is VC++ needed only for werl.exe? I hope so. One problem: the latest snapshot otp_src_P9C_2003-07-11.tar.gz gives errors in cygwin when unpacking Vlad@REDACTED ~/Mina dokument/projects $ tar xfv otp_src_P9C_2003-07-11.tar tar: This does not look like a tar archive tar: Skipping to next header tar: Archive contains obsolescent base-64 headers tar: Error exit delayed from previous errors Vlad@REDACTED ~/Mina dokument/projects $ tar xfz otp_src_P9C_2003-07-11.tar.gz tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now best regards, Vlad From francesco@REDACTED Sat Jul 12 08:43:16 2003 From: francesco@REDACTED (Francesco Cesarini) Date: Sat, 12 Jul 2003 07:43:16 +0100 Subject: Contribution to the record- and write-your-own-guards debates References: <3F0DBA8E.40709@theheartofgold.org> Message-ID: <3F0FAE04.9060102@erlang-consulting.com> > There is one thing I have been missing in the ongoing debate of > replacing/complementing records with a new and "better" construct. > This may be because most people find it too obvious to mention. I > think it's worth mentioning. Joe Armstrong has some excellent ideas for dynamic records that fit excellently into the language, pretty syntax, and from what I understood, no hidden ugly side effects. It is exactly what you (And many others) are asking for. When we send our wish list to Father Xmas, we should all CC Joe. > To me what makes records great (I think they are) is that they can be > inserted into ETS and DETS tables. And be able to use them from the shell, and support in the debugging tools.... Regards, Francesco -- http://www.erlang-consulting.com From Francesco.Cesarini@REDACTED Fri Jul 11 12:51:21 2003 From: Francesco.Cesarini@REDACTED (Francesco Cesarini) Date: Fri, 11 Jul 2003 11:51:21 +0100 Subject: where os:getenv defined? Message-ID: <3D5E4EFE4053D311924F0008C791DC78071670C0@elg01mbx.t-mobile.co.uk> Is os:getenv a BIF? Why isn't it defined and exported in the os module? (camelns@REDACTED)26> os:getenv("ROOTDIR"). "/export/home/otpuser/camelns" (camelns@REDACTED)27> m(os). Module os compiled: Date: May 23 2002, Time: 10.43 Compiler options: [v3, debug_info, {i,"/clearcase/otp/erts/lib/kernel/src/../include"}, {outdir,"/clearcase/otp/erts/lib/kernel/src/../ebin"}, {cwd,'/clearcase/otp/erts/lib/kernel/src'}] Object file: /export/home/otpuser/camelns/lib/kernel-2.7.3/ebin/os.beam Exports: cmd/1 find_executable/1 find_executable/2 module_info/0 module_info/1 type/0 unix_cmd1/2 version/0 ok -- Francesco Cesarini, Erlang/OTP Consultant Tel: +44 (0)7776 250 381 Web: http://www.erlang-consulting.com NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Johan.Garpendahl@REDACTED Thu Jul 10 14:45:48 2003 From: Johan.Garpendahl@REDACTED (Johan Garpendahl) Date: Thu, 10 Jul 2003 14:45:48 +0200 (MEST) Subject: Is it a list ? In-Reply-To: <3F0D32B6.90503@eth.ericsson.se> (message from Zoltan Peter Toth on Thu, 10 Jul 2003 11:32:38 +0200) References: <3F0D32B6.90503@eth.ericsson.se> Message-ID: <200307101245.h6ACjmD07575@lm9007.lmera.ericsson.se> Hello Zoltan! This is a slightly simplified explaination. I think each element in a list has two parts. The first part contains a pointer to the actual element and the other part points to the next element in the list. In a simple list, the first part points a number. In a less simple list, the first element could point to another list. At the end of a list, you usually want to put an emty list element. That could be represented by a null pointer. To modify your example, that would be: 1> X = [1,2|[]]. [1,2] That is, [1,2|[]] and [1,2] is exactly the same thing. [1,2] is somewhat shorter to write. Hope I have explained more than I have confused. Regards, Johan >>>>> "Zoltan" == Zoltan Peter Toth writes: Zoltan> Hi ! I've made a little test in the Erlang machine: Zoltan> 1> X = [1|2]. Zoltan> [1|2] Zoltan> Now, my big question is, WHAT an object is X ? Zoltan> 2> is_list(X). Zoltan> true Zoltan> So, it is a list, but not a well formed one: Zoltan> 3> list_to_tuple(X). Zoltan> =ERROR REPORT==== 10-Jul-2003::11:09:15 === Error in process Zoltan> <0.26.0> with exit value: Zoltan> {badarg,[{erlang,list_to_tuple,[[1|2]]},{erl_eval,expr,3},{erl_eval,exprs,4},{shell,eval_loop,2}]} Zoltan> ** exited: {badarg,[{erlang,list_to_tuple,[[1|2]]}, Zoltan> {erl_eval,expr,3}, {erl_eval,exprs,4}, {shell,eval_loop,2}]} Zoltan> ** Zoltan> 9> length(X). Zoltan> =ERROR REPORT==== 10-Jul-2003::11:12:42 === Error in process Zoltan> <0.39.0> with exit value: Zoltan> {badarg,[{erlang,length,[[1|2]]},{erl_eval,expr,3},{erl_eval,exprs,4},{shell,eval_loop,2}]} Zoltan> ** exited: {badarg,[{erlang,length,[[1|2]]}, Zoltan> {erl_eval,expr,3}, {erl_eval,exprs,4}, {shell,eval_loop,2}]} Zoltan> ** Zoltan> ... so what is the structure and what are the elements and the Zoltan> length of this weird list ? Thanks for any answer, Zoltan From kent@REDACTED Sat Jul 12 10:11:18 2003 From: kent@REDACTED (Kent Boortz) Date: 12 Jul 2003 10:11:18 +0200 Subject: P9C In-Reply-To: References: Message-ID: "Vlad Dumitrescu" writes: > But I can't find any README.win32 in them anyways... :-( Sorry, it will be in the package. In the mean time you can download it from http://www.erlang.org/download/README.win32 Note that the top README file is not updated. The normal way to build is to use the "otp_build" script. We will update the README as soon, kent From thomasl_erlang@REDACTED Sat Jul 12 11:16:47 2003 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Sat, 12 Jul 2003 02:16:47 -0700 (PDT) Subject: where os:getenv defined? In-Reply-To: <3D5E4EFE4053D311924F0008C791DC78071670C0@elg01mbx.t-mobile.co.uk> Message-ID: <20030712091647.36467.qmail@web41903.mail.yahoo.com> --- Francesco Cesarini wrote: > Is os:getenv a BIF? Why isn't it defined and > exported in the os module? That one has bit me too. Have a look at erlang:is_builtin(M,F,A). Best, Thomas __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From fritchie@REDACTED Sat Jul 12 20:25:16 2003 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Sat, 12 Jul 2003 13:25:16 -0500 Subject: ETS 'set' table bug ... or not? Message-ID: <200307121825.h6CIPGEU010957@snookles.snookles.com> Hi there. While running some tests on a borrowed Pentium 4 Xeon RedHat 8.0 Linux box, I encountered a segmentation violation problem that puzzled me. I'm not certain if it's a bug in ETS or if it is a problem with the hardware. The hardware claims to have ECC memory, so it's unlikely (but not impossible, I suppose) that bad RAM is causing the problem. The code for test.erl is included below. If I run the command line: erl -noinput -s test do set insert_rand 7000 delete_all \ traverse_forward -s erlang halt ... no problem. If I use a bigger number than 7000, no problem ... until I use this number: 53999154. Then I get a segmentation violation every time, apparently while the 'delete_all' part of the test is running. WARNING: The process size grows to about 2.6GB. I was borrowing CPU cycles on this machine. Alas, I no longer have convenient access to that machine. Could someone else with a 3-4GB Pentium 4 box check to see if they can reproduce the problem? It would be good to know if this is an actual ETS bug. (I was using R9B-1 for my testing.) -Scott --- snip --- snip --- snip --- snip --- snip --- snip --- snip --- -module(test). -export([do/1]). %%% Internal exports -export([ delete_all/0, delete_all/2, insert_rand/0, insert_rand/2, traverse_forward/0, traverse_forward/2 ]). %%% Debugging exports -export([unatomify/1, test_defined/1]). %%% We use single arg style for do() so that we can automate via %%% "erl -s test2 do bag insert_seq 400" or %%% "erl -s test2 do set insert 11000000 3 traverse_forw lookup_seq 11000000" do(ArgList) when list(ArgList) -> [TabType|AList] = unatomify(ArgList), Tab = ets:new(t, [TabType, private]), Res = do2(Tab, AList), format_results(Res), Res. do2(Tab, AList) -> FAndAList = parse_alist(AList), [{DoFunc, timer:tc(?MODULE, DoFunc, [Args, Tab])} || {DoFunc, Args} <- FAndAList]. delete_all() -> ok. delete_all([], Tab) -> ets:safe_fixtable(Tab, true), V = delete_all2(ets:first(Tab), Tab), ets:safe_fixtable(Tab, false), V. delete_all2('$end_of_table', Tab) -> ok; delete_all2(Key, Tab) -> Next = ets:next(Tab, Key), ets:delete(Tab, Key), delete_all2(Next, Tab). insert_rand() -> ok. insert_rand([N], Tab) -> insert_rand([N, N], Tab); insert_rand([Num, MaxKey], Tab) -> insert_rand([Num, MaxKey, 1], Tab); insert_rand([Num, MaxKey, Val], Tab) -> insert_rand(Num, MaxKey div 4, make_randfun(MaxKey), Val, Tab). insert_rand(0, Last, RandFun, Val, Tab) -> ok; insert_rand(N, Last, RandFun, Val, Tab) -> New = RandFun(Last), true = ets:insert(Tab, {New, Val}), insert_rand(N - 1, New, RandFun, Val, Tab). traverse_forward() -> ok. traverse_forward([], Tab) -> traverse_forward2(ets:first(Tab), Tab). traverse_forward2('$end_of_table', Tab) -> ok; traverse_forward2(Key, Tab) -> traverse_forward2(ets:next(Tab, Key), Tab). %%% %%% Low-level stuff below here %%% do_loop(N, Fun) -> do_loop_skip(N, 1, 0, Fun). do_loop_skip(N, Skip, Stop, _) when N =< Stop -> ok; do_loop_skip(N, Skip, Stop, Fun) -> Fun(N), do_loop_skip(N - Skip, Skip, Stop, Fun). %%% %%% smaller_prime()'s algorithm stolen from erl_db.c. %%% smaller_prime(N) when N rem 2 == 0 -> smaller_prime(N - 1); smaller_prime(N) -> NModI = smaller_prime_for(3, N), if NModI * NModI > N -> N; true -> smaller_prime(N - 2) end. smaller_prime_for(I, N) when I * I =< N -> if N rem I == 0 -> I; true -> smaller_prime_for(I + 2, N) end; smaller_prime_for(I, N) -> I. %%% unatomify() can now convert atoms such as '{foo, bar}' and '[1, foo, 3]' unatomify([]) -> []; unatomify([H|T]) when atom(H) -> L = atom_to_list(H), [LH|LT] = L, if LH >= $0, LH =< $9 -> [list_to_integer(L) | unatomify(T)]; LH == $- -> [list_to_integer(L) | unatomify(T)]; LH == ${; LH == $[ -> case erl_scan:string(L) of {ok, Tokens, _} -> case erl_parse:parse_term(Tokens ++ [{dot, 1}]) of {ok, List} when list(List) -> [List | unatomify(T)]; {ok, Term} -> [Term | unatomify(T)]; _ -> [H | unatomify(T)] end; _ -> [H | unatomify(T)] end; true -> [H | unatomify(T)] end; unatomify([H|T]) -> [H | unatomify(T)]. parse_alist([]) -> []; parse_alist([Func|T]) -> case test_defined(Func) of true -> {Args, Rest} = parse_alist2(T), [{Func, Args} | parse_alist(Rest)]; false -> throw({bad_funcname, Func}) end. parse_alist2(L) -> parse_alist2(L, []). parse_alist2([], Acc) -> {lists:reverse(Acc), []}; parse_alist2([H|T] = L, Acc) -> case test_defined(H) of true -> {lists:reverse(Acc), L}; false -> parse_alist2(T, [H|Acc]) end. test_defined(F) -> case catch apply(?MODULE, F, []) of ok -> true; _ -> false end. %%% This function is fairly fast and typically hits at least 1/2 of %%% total space from 0 through N, often more. Careful choices of N %%% can result in covering all values of 0 through N. make_randfun(N) -> SmallerPrime = smaller_prime(N), YetSmallerPrime = smaller_prime(SmallerPrime - 1), fun(Old) -> (Old * SmallerPrime) rem YetSmallerPrime end. format_results([]) -> ok; format_results([H|T]) -> case H of {Test, {N, ok}} when is_integer(N) -> io:format("~w ok ~w\n", [Test, N]); {Test, {N, Huh}} when is_integer(N) -> io:format("~w FAIL ~w : ~w\n", [Test, N, Huh]); _ -> foo end, format_results(T). From Marc.Vanwoerkom@REDACTED Sun Jul 13 07:20:43 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Sun, 13 Jul 2003 07:20:43 +0200 (MEST) Subject: Piccola and Pi Calculus In-Reply-To: <4.2.2.20030609180034.00cec970@duomark.com> (message from Jay Nelson on Mon, 09 Jun 2003 18:02:02 -0700) Message-ID: <200307130520.h6D5KhN28141@bonsai.fernuni-hagen.de> > Anybody familiar with Piccola and the Pi Calculus. It looks > like a formalization of the erlang concepts (apparently without > any knowledge of the existence of erlang). > > http://iamwww.unibe.ch/~scg/Research/Piccola/ Lambda calculus is the traditional mathematical theory behind functional programming. It would make sense to come up with an extension regarding concurrency to model something like Erlang. How established that Pi calculus is I would like to know. But perhaps this is all still in research stage and there is no established theory behind concurrent computation yet. Some other interesting formal tools I saw last year were finite automatons over infinite words to model processes, where certain product constructions are used to model synchronized and unsynchronized processes. Regards, Marc From Marc.Vanwoerkom@REDACTED Sun Jul 13 07:23:14 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Sun, 13 Jul 2003 07:23:14 +0200 (MEST) Subject: Grid Wars Message-ID: <200307130523.h6D5NEm28238@bonsai.fernuni-hagen.de> Here is a competition http://www.gridwars.com that uses/promotes a parallel C like language: CxC Regards, Marc From mikael.karlsson@REDACTED Sun Jul 13 20:34:30 2003 From: mikael.karlsson@REDACTED (Mikael Karlsson) Date: Sun, 13 Jul 2003 20:34:30 +0200 Subject: Please test snapshots of the coming R9C In-Reply-To: References: Message-ID: <200307132034.31710.mikael.karlsson@creado.com> It seems that the ssl:peercert function crashes if there is an "unexpected" object identifier. I am trying to read a cert from the Swedish Postens eID (Smartcard) . It does not crash if I use the options [pkix, subject] instead of [ssl, subject] in the example below. /Mikael ERROR erlang code crashed: File: /home/mikael/public_html/getpeercert.yaws:8 Reason: {function_clause,[{ssl_pkix_oid,id2atom,[{1,2,752,34,2,1}]}, {ssl_pkix,transform,1}, {lists,map,2}, {ssl_pkix,transform,1}, {ssl_pkix,decode_cert,2}, {m3,out,1}, {yaws_server,yaws_call,8}, {yaws_server,deliver_dyn_file,10}| more]} Req: {http_request,'GET',{abs_path,"/getpeercert.yaws"},{1,1}} yaws code: .. out(A) -> case Res = ssl:peercert(A#arg.clisock,[ssl, subject]) of {ok,Sequence} -> {html,io_lib:format("Accept: peer cert:~n~p~n", [Sequence])}; _ -> {ehtml,{p,[],f("Error in peer cert sequence ~p", [Res])}} end. ... From bjorn@REDACTED Mon Jul 14 15:12:18 2003 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 14 Jul 2003 15:12:18 +0200 Subject: Please test snapshots of the coming R9C In-Reply-To: <440A2703A54A8F4FB2AC2AE34F27129D215AD1@ESEALNT889.al.sw.ericsson.se> References: <440A2703A54A8F4FB2AC2AE34F27129D215AD1@ESEALNT889.al.sw.ericsson.se> Message-ID: The erl_tar patch will be included in R9C. /Bjorn "Erik Reitsma (RY/ETM)" writes: > Hi, > > > It is now less than a month to the R9C release. The code is frozen but > > we are still doing some testing, adding some missing documentation and > > release notes. > > I looked at the code and it seems that my ASN.1 patch for ObjectDescriptor (replacing 'OBJECT_DESCRIPTOR' with 'ObjectDescriptor' in all erlang source) and my erl_tar patch (use the magic 'ustar\0', fixing problems with paths > 100 bytes when untarring with other tar tools) have not yet been included. That is unfortunate, since it means that I will have to patch R9C as I had to patch R9B-1. > > *Erik. > -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From bjorn@REDACTED Mon Jul 14 15:11:35 2003 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 14 Jul 2003 15:11:35 +0200 Subject: patch for SO_BSDCOMPAT problem on 2.5 Linux development kernels In-Reply-To: <200307091915.h69JFQli025522@harpo.it.uu.se> References: <200307091915.h69JFQli025522@harpo.it.uu.se> Message-ID: We'll include this patch in R9C. /Bjorn Mikael Pettersson writes: > SO_BSDCOMPAT is obsolete since the 2.4 kernels, and now 2.5 kernels > log a warning every time it is used. This is a problem since beam > uses it unconditionally even though it only makes a difference in very > old kernels (2.2 and older). > > This patch fixes the problem. It performs a runtime kernel version test, > since that's what Raimo Niskanen preferred. It would be nice to get this > fix into OpenSource R9C-0, even if it's too late for the commercial > release. (Tested with kernels 2.2.25, 2.4.21, and 2.5.74.) > > /Mikael Pettersson > The HiPE group. -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From fredrik.linder@REDACTED Mon Jul 14 15:16:00 2003 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Mon, 14 Jul 2003 15:16:00 +0200 Subject: Beam-to-erlang Message-ID: Hello folks Do you know of any avilable tool to reverse-engineer a .beam file back to a .erl file? Cheers /Fredrik From info@REDACTED Tue Jul 15 13:05:03 2003 From: info@REDACTED (Levada.com) Date: Tue, 15 Jul 2003 13:05:03 +0200 Subject: Grid Wars References: <200307130523.h6D5NEm28238@bonsai.fernuni-hagen.de> Message-ID: <017a01c34ac1$1b2ca4c0$0700a8c0@ulla> Here is an article from slashdot regarding "Gridwars" Gridwars Parallel Programming Challenge Peter_Pork writes "New Scientist has an article about GridWars, a challenging new game that runs on large clusters of computers. Programs fight each other for supremacy in terms of the number of processors they control, and the main point of the contest is to develop better parallel algorithms. It seems a nice idea: have fun while you improve the state-of-the-art in cluster computing. The result of the last contest was somewhat of an upset, since a craftsmanly Russian program defeated a sophisticated genetic algorithm from NASA." Rgds Ingmar ----- Original Message ----- From: "Marc Ernst Eddy van Woerkom" To: Sent: Sunday, July 13, 2003 7:23 AM Subject: Grid Wars > Here is a competition > > http://www.gridwars.com > > that uses/promotes a parallel C like language: CxC > > Regards, > Marc > From info@REDACTED Tue Jul 15 14:55:12 2003 From: info@REDACTED (Levada.com) Date: Tue, 15 Jul 2003 14:55:12 +0200 Subject: Grid Wars References: <200307130523.h6D5NEm28238@bonsai.fernuni-hagen.de> <017a01c34ac1$1b2ca4c0$0700a8c0@ulla> Message-ID: <019801c34ad0$5665f000$0700a8c0@ulla> Sorry, forgot to include the link to this article: http://www.newscientist.com/news/print.jsp?id=ns99993922 Rgds Ingmar ----- Original Message ----- From: "Levada.com" To: "Marc Ernst Eddy van Woerkom" ; Sent: Tuesday, July 15, 2003 1:05 PM Subject: Re: Grid Wars > Here is an article from slashdot regarding "Gridwars" > > Gridwars Parallel Programming Challenge > Peter_Pork writes "New Scientist has an article about GridWars, a > challenging new game that runs on large clusters of computers. Programs > fight each other for supremacy in terms of the number of processors they > control, and the main point of the contest is to develop better parallel > algorithms. It seems a nice idea: have fun while you improve the > state-of-the-art in cluster computing. The result of the last contest was > somewhat of an upset, since a craftsmanly Russian program defeated a > sophisticated genetic algorithm from NASA." > > Rgds > > Ingmar > > > ----- Original Message ----- > From: "Marc Ernst Eddy van Woerkom" > To: > Sent: Sunday, July 13, 2003 7:23 AM > Subject: Grid Wars > > > > Here is a competition > > > > http://www.gridwars.com > > > > that uses/promotes a parallel C like language: CxC > > > > Regards, > > Marc > > > From lennart.ohman@REDACTED Wed Jul 16 23:15:36 2003 From: lennart.ohman@REDACTED (=?ISO-8859-1?Q?Lennart_=D6hman?=) Date: Wed, 16 Jul 2003 23:15:36 +0200 Subject: Bay Area ErlLounge Monday 28 July Message-ID: <3F15C078.4050801@st.se> Hi everyone, we are a couple of Erlang hackers who managed to organize an ErlLounge in the Bay Area. Exact time and place not decided yet, but the date is. Anyone interested to join? send an email! /Lennart ------------------------------------------------------------- Lennart Ohman phone : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 6735 Sehlstedtsgatan 6 fax : +46-8-667 8230 SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED From byron.hale@REDACTED Wed Jul 16 23:44:01 2003 From: byron.hale@REDACTED (Byron Hale) Date: Wed, 16 Jul 2003 14:44:01 -0700 Subject: San Francisco Bay Area ErlLounge Monday 28 July In-Reply-To: <3F15C078.4050801@st.se> Message-ID: <5.2.0.9.2.20030716144040.026f1380@einfo.com> Yes, we are the center of the universe and there's no better place to live :=) Its the San Francisco Bay Area ErlLounge Monday 28 July. Byron At 11:15 PM 7/16/2003 +0200, Lennart wrote: >Hi everyone, >we are a couple of Erlang hackers who managed to organize >an ErlLounge in the Bay Area. >Exact time and place not decided yet, but the date is. Anyone >interested to join? send an email! > >/Lennart > >------------------------------------------------------------- >Lennart Ohman phone : +46-8-587 623 27 >Sjoland & Thyselius Telecom AB cellular: +46-70-552 6735 >Sehlstedtsgatan 6 fax : +46-8-667 8230 >SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED From kent@REDACTED Thu Jul 17 10:10:04 2003 From: kent@REDACTED (Kent Boortz) Date: 17 Jul 2003 10:10:04 +0200 Subject: Please test snapshots of the coming R9C In-Reply-To: References: Message-ID: snickl@REDACTED writes: > The problem seems to be that the part of the build that makes the > directories "believes" the --host option, while the part that > generates the makefiles goes with autodetection. Haven't tried it but this may work % ./configure --host=i386-pc-linux-gnu % make TARGET=i386-pc-linux-gnu > This gets you trouble when you want to use binaries on different machines, > but compile (as always) on the fastest around. Are you sure -host will make a difference for vanilla "configure" scripts, i.e. that it will set -mARCH to gcc? I know it will if you build gcc or maybe recompile a kernel but I thought this was because they explicitely handled this in their "configure.in". I haven't tried this but mayby something like (in sh/bash) % CFLAGS="-g -O2 -m386" ./configure will work if we pass CFLAGS correctly between the make files. If nothing of the above works I'm afraid we will not be able to do something about this to R9C-0, kent From snickl@REDACTED Thu Jul 17 11:36:13 2003 From: snickl@REDACTED (Stefan Nickl) Date: Thu, 17 Jul 2003 11:36:13 +0200 (CEST) Subject: Please test snapshots of the coming R9C In-Reply-To: Message-ID: On 17 Jul 2003, Kent Boortz wrote: > snickl@REDACTED writes: > > The problem seems to be that the part of the build that makes the > > directories "believes" the --host option, while the part that > > generates the makefiles goes with autodetection. > > Haven't tried it but this may work > > % ./configure --host=i386-pc-linux-gnu > % make TARGET=i386-pc-linux-gnu This solutions works for me, thanks! It also works when changing gentoo's erlang-ebuild from "make || die" to "make TARGET=${CHOST} || die" (with CHOST set to i386 from make.conf) > > This gets you trouble when you want to use binaries on different machines, > > but compile (as always) on the fastest around. > > Are you sure -host will make a difference for vanilla "configure" > scripts, i.e. that it will set -mARCH to gcc? I know it will if you > build gcc or maybe recompile a kernel but I thought this was because > they explicitely handled this in their "configure.in". No, it doesn't get set. I think youre on the wrong track here, my issue was about Makefiles trying to run each other, but looking in the wrong place. The process didn't even get far enough to run the compiler. CU, SN -- The UNIX equivalent of the "Blue Screen of Death" would be called "kernel panic". It obviously exists, since I have heard and read about it, but I've never been witness to it in my professional career. John Kirch, Networking Consultant and Microsoft Certified Professional (Windows NT) From HEINRICH.VENTER@REDACTED Thu Jul 17 11:43:36 2003 From: HEINRICH.VENTER@REDACTED (HEINRICH VENTER) Date: Thu, 17 Jul 2003 11:43:36 +0200 Subject: binary_to_term size limit Message-ID: Hi I recently had a strange thing happen to me with binary_to_term. When the binary got large it gave a bad term error. I am not sure what the exact size is, but it is larger than 10kb at least. I have solved the problem by breaking up the data into separate lists of smaller size and rebuilding it as terms, but would love to know what the reason for the odd behavior is. There is some limmit to what bianry_to_term can convert then? -]-[enirich ##################################################################################### The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy or copies. ##################################################################################### From epktoab@REDACTED Thu Jul 17 12:26:31 2003 From: epktoab@REDACTED (Tomas Abrahamsson) Date: Thu, 17 Jul 2003 12:26:31 +0200 (MEST) Subject: ETS 'set' table bug ... or not? In-Reply-To: <200307121825.h6CIPGEU010957@snookles.snookles.com> (message from Scott Lystig Fritchie on Sat, 12 Jul 2003 13:25:16 -0500) Message-ID: <200307171026.h6HAQVo06531@lm9075.lmera.ericsson.se> > Hi there. While running some tests on a borrowed Pentium 4 Xeon > RedHat 8.0 Linux box, I encountered a segmentation violation problem > that puzzled me. I'm not certain if it's a bug in ETS or if it is a > problem with the hardware. The hardware claims to have ECC memory, so > it's unlikely (but not impossible, I suppose) that bad RAM is causing > the problem. > > The code for test.erl is included below. If I run the command line: > > erl -noinput -s test do set insert_rand 7000 delete_all \ > traverse_forward -s erlang halt > > ... no problem. If I use a bigger number than 7000, no problem > ... until I use this number: 53999154. Then I get a segmentation > violation every time, apparently while the 'delete_all' part of the > test is running. It crashes with a segmentation fault, apparently during delete_all, on our Sun Blade-1000 as well. It produces a core file 2147483647 (== 2^31-1) bytes long. However, here it doesn't crash for 53999154, but for a number somewhere between 52750000 and 52875000, I didn't have time to pinpoint it further. (erts-5.2.3.7, Solaris 8, the machine has 4GB RAM.) /Tomas From seb@REDACTED Thu Jul 17 18:24:57 2003 From: seb@REDACTED (Sebastian Strollo) Date: 17 Jul 2003 09:24:57 -0700 Subject: binary_to_term size limit In-Reply-To: References: Message-ID: <4wwr84pi0iu.fsf@locke.strollo.org> "HEINRICH VENTER" writes: > I recently had a strange thing happen to me with binary_to_term. > When the binary got large it gave a bad term error. I am not sure > what the exact size is, but it is larger than 10kb at least. The term must have gone stale, how did you transport it? :-) Normally size doesn't matter :-) as long as you have enought memory for it. Erlang (BEAM) emulator version 5.2 [source] [hipe] [threads:0] Eshell V5.2 (abort with ^G) 1> A=lists:duplicate(1000000, {a,b,c}). [{a,b,c}, {a,b,c}, ... 2> size(term_to_binary(A)). 14000007 3> A = binary_to_term(term_to_binary(A)). [{a,b,c}, {a,b,c}, {a,b,c}, ... 4> /Sebastian From HEINRICH.VENTER@REDACTED Fri Jul 18 09:15:42 2003 From: HEINRICH.VENTER@REDACTED (HEINRICH VENTER) Date: Fri, 18 Jul 2003 09:15:42 +0200 Subject: binary_to_term size limit Message-ID: >The term must have gone stale, how did you transport it? :-) Stale? I used erl_interface. The term is constructed in C code. Perhaps erl_encode has a size limmit for the term it can encode then? I used erl_term_len to allocate a buffer of the correct size, and the allocation goes smoothly. Once the binary representation is recieved by erlang the binary_to_term call fails. It works for smaller terms, so logically somewhere along the line a size limmit exists. Perhaps the limmit is internal to erl_interface? Thanks -]-[einrich ##################################################################################### The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy or copies. ##################################################################################### From olgeni@REDACTED Fri Jul 18 17:14:44 2003 From: olgeni@REDACTED (Jimmy Olgeni) Date: Fri, 18 Jul 2003 17:14:44 +0200 (CEST) Subject: term_to_binary from jinterface (?) Message-ID: <20030718170822.E65446@dev1.localdomain.net> Hi, Quick encoding question :) I'm trying to implement "term_to_binary" in a Java client, using something like: OtpOutputStream otpOutputStream = new OtpOutputStream (whateverTerm); and then sending the byte array from "otpOutputStream.toByteArray()" over a connected TCP socket. The server part (erlang) uses binary_to_term to parse the data packet, but consistently fails because the byte array from "toByteArray" lacks the versionTag at byte 0 (that is, 131). I see that the versionTag is managed when receiving messages, but is not inserted when encoding: am I supposed to provide my own versionTag in encoded packets? -- jimmy From cpressey@REDACTED Fri Jul 18 21:05:01 2003 From: cpressey@REDACTED (Chris Pressey) Date: Fri, 18 Jul 2003 14:05:01 -0500 Subject: Good practice In-Reply-To: References: Message-ID: <20030718140501.36f1bf1a.cpressey@catseye.mb.ca> On Sun, 8 Jun 2003 17:28:01 -0400 (EDT) erlang@REDACTED wrote: > bash$ erl > Erlang (JAM) emulator version 47.4.1 > > Eshell V47.4.1 (abort with ^G) > 1> c(test1file). > ./test1file.erl:172: Warning: variable 'Response' exported from > ['case']{ok,test1file} > 2> > > > From the file in question: > > case checkvalid(Funcref, Correctlist) of > false -> > Response = false; > Other -> > Response = invoker(Other, Otherargs) > end, > Requester ! Response, I've never actually understood why this isn't a full-fledged error. Is there a good reason that bindings are allowed to 'leak' out of a case..end? My language designer's intuition is telling me that the scoping rules for case..end should be more like those for fun..end. -Chris From seb@REDACTED Fri Jul 18 19:01:31 2003 From: seb@REDACTED (Sebastian Strollo) Date: 18 Jul 2003 10:01:31 -0700 Subject: binary_to_term size limit In-Reply-To: References: Message-ID: <4wwfzl3u5uc.fsf@locke.strollo.org> "HEINRICH VENTER" writes: > >The term must have gone stale, how did you transport it? :-) > > Stale? Kidding. I was trying to get you to give us more details, like the ones below: > I used erl_interface. I haven't actually used erl_interface myself, so I'll leave the more educated guessing to someone else. But basically the external term format does not have any size limitations (as such, but there are limitations, e.g. the beam emulator doesn't allow larger atoms than 255 characters et.c.) , so I would look at either how you create the terms (does erl_interface allow you to create "illegal" terms?) or how you send the term to erlang (are you getting partial terms?) > The term is constructed in C code. Perhaps > erl_encode has a size limmit for the term it can encode then? I > used erl_term_len to allocate a buffer of the correct size, and the > allocation goes smoothly. Once the binary representation is > recieved by erlang the binary_to_term call fails. It works for > smaller terms, so logically somewhere along the line a size limmit > exists. Perhaps the limmit is internal to erl_interface? Just my 2c worth... /Sebastian From lennart.ohman@REDACTED Fri Jul 18 21:21:05 2003 From: lennart.ohman@REDACTED (=?ISO-8859-1?Q?Lennart_=D6hman?=) Date: Fri, 18 Jul 2003 21:21:05 +0200 Subject: Good practice References: <20030718140501.36f1bf1a.cpressey@catseye.mb.ca> Message-ID: <3F1848A1.6050506@st.se> Hi, one might think so. But not every one considers a case statement to be a scope of its own. Anyway *a lot* of now existing code if programmed the way demonstrated below making changing it completely out of question. If I am not mistaken presenting a warning was a compromise introduced some years ago. /Lennart Chris Pressey wrote: > On Sun, 8 Jun 2003 17:28:01 -0400 (EDT) > erlang@REDACTED wrote: > > >>bash$ erl >>Erlang (JAM) emulator version 47.4.1 >> >>Eshell V47.4.1 (abort with ^G) >>1> c(test1file). >>./test1file.erl:172: Warning: variable 'Response' exported from >>['case']{ok,test1file} >>2> >> >> >>From the file in question: >> >> case checkvalid(Funcref, Correctlist) of >> false -> >> Response = false; >> Other -> >> Response = invoker(Other, Otherargs) >> end, >> Requester ! Response, > > > I've never actually understood why this isn't a full-fledged error. > > Is there a good reason that bindings are allowed to 'leak' out of a > case..end? > > My language designer's intuition is telling me that the scoping rules > for case..end should be more like those for fun..end. > > -Chris -- ------------------------------------------------------------- Lennart Ohman phone : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 6735 Sehlstedtsgatan 6 fax : +46-8-667 8230 SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED From willem@REDACTED Fri Jul 18 18:02:07 2003 From: willem@REDACTED (Willem Broekema) Date: Fri, 18 Jul 2003 18:02:07 +0200 Subject: binary: -1 versus 255 Message-ID: <3F1819FF.7060707@pastelhorn.com> Is this a bug in binary matching? 6> << -1 >>. <<255>> 7> << -1 >> = << 255 >>. % I expected this to match ** exited: {{badmatch,<<255>>}, [{erl_eval,expr,3}]} ** 8> A = << -1 >>. <<255>> 9> << 255 >> = A. <<255>> - Willem From carsten@REDACTED Fri Jul 18 22:37:11 2003 From: carsten@REDACTED (Carsten Schultz) Date: Fri, 18 Jul 2003 22:37:11 +0200 Subject: Good practice In-Reply-To: <20030718140501.36f1bf1a.cpressey@catseye.mb.ca> References: <20030718140501.36f1bf1a.cpressey@catseye.mb.ca> Message-ID: <20030718203711.GA11239@penne.localnet> Hi! On Fri, Jul 18, 2003 at 02:05:01PM -0500, Chris Pressey wrote: > Is there a good reason that bindings are allowed to 'leak' out of a > case..end? This is completely in line with Erlang being an imperative language and expressions having side effects. :-) > My language designer's intuition is telling me that the scoping rules > for case..end should be more like those for fun..end. I do not know, if I like the binding rules for `case', but they my be handy. `Fun' is of course different, because `fun's are constructed for later use, while `case's are evaluated. Carsten -- Carsten Schultz (2:40, 33:47), FB Mathematik, FU Berlin http://carsten.fu-mathe-team.de/ PGP/GPG key on the pgp.net key servers, fingerprint on my home page. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 240 bytes Desc: not available URL: From valentin@REDACTED Sat Jul 19 10:45:12 2003 From: valentin@REDACTED (Valentin) Date: Sat, 19 Jul 2003 10:45:12 +0200 Subject: binary_to_term size limit References: Message-ID: <005801c34dd2$74b05550$01010d0a@moneymaker> Hello Heinrich, I had a similar problem... well, about 2+ years ago with erl_interface library -- it appears that this library is using fix-size buffer and that can cause the problem you're referring to. However, as far as I can remember, our C/C++ programs did crash & burn when we tried to push large amount of data using a single send. On the other hand, the new "ei" library doesn't seem to have the same limitation regarding the size, but introduced few... say, considerations. For example, if you are using ei_send, the term that you're sending must be prefixed with version magic number. This is not needed for ei_rpc, as the function does it for you. We wrote few C++ wrappers around ei library and never looked back -- it works very well for us (although, I must say, we try to keep our C++, or rather non-Erlang exposure to a bare minimum). Valentin. PS It appears that you're based in South Africa? If so, give me a ring so we can exchange experiences. (+27 83 212 9180) ----- Original Message ----- From: "HEINRICH VENTER" To: Cc: Sent: Friday, July 18, 2003 9:15 AM Subject: Re: binary_to_term size limit > >The term must have gone stale, how did you transport it? :-) > Stale? > I used erl_interface. The term is constructed in C code. Perhaps erl_encode has a size limmit for the term it can encode then? I used erl_term_len to allocate a buffer of the correct size, and the allocation goes smoothly. > Once the binary representation is recieved by erlang the binary_to_term call fails. It works for smaller terms, so logically somewhere along the line a size limmit exists. Perhaps the limmit is internal to erl_interface? > > Thanks > > -]-[einrich > > ############################################################################ ######### > The information contained in this message and or attachments is intended > only for the person or entity to which it is addressed and may contain > confidential and/or privileged material. Any review, retransmission, > dissemination or other use of, or taking of any action in reliance upon, > this information by persons or entities other than the intended recipient > is prohibited. If you received this in error, please contact the sender and > delete the material from any system and destroy or copies. > ############################################################################ ######### From per@REDACTED Mon Jul 21 08:40:21 2003 From: per@REDACTED (Per Bergqvist) Date: Mon, 21 Jul 2003 09:40:21 +0300 Subject: Please test snapshots of the coming R9C In-Reply-To: Message-ID: <200307210740.h6L7eLF20679@tessla.levonline.com> Hej Kent, just got back from a weeks vacation and noticed that my patch has not yet been included in the later snapshots (as least not in 2003-07-18). Is it only due to vacations or do you want it reworked in any way ? Best Regards Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From richardc@REDACTED Mon Jul 21 11:42:24 2003 From: richardc@REDACTED (Richard Carlsson) Date: Mon, 21 Jul 2003 11:42:24 +0200 (MET DST) Subject: Good practice In-Reply-To: <20030718140501.36f1bf1a.cpressey@catseye.mb.ca> References: <20030718140501.36f1bf1a.cpressey@catseye.mb.ca> Message-ID: A bit late (hey, it's summer), but I thought I should try to give an explanation of this behaviour. On Fri, 18 Jul 2003, Chris Pressey wrote: > On Sun, 8 Jun 2003 17:28:01 -0400 (EDT) > erlang@REDACTED wrote: > > > bash$ erl > > Erlang (JAM) emulator version 47.4.1 > > > > Eshell V47.4.1 (abort with ^G) > > 1> c(test1file). > > ./test1file.erl:172: Warning: variable 'Response' exported from > > ['case']{ok,test1file} > > 2> Wow! JAM version 47.4.1! This is an ancient system. (On the other hand, that particular compiler warning was not changed until BEAM R7 or R8, so a lot of other people may also see this warning still.) > > From the file in question: > > > > case checkvalid(Funcref, Correctlist) of > > false -> > > Response = false; > > Other -> > > Response = invoker(Other, Otherargs) > > end, > > Requester ! Response, > > I've never actually understood why this isn't a full-fledged error. > > Is there a good reason that bindings are allowed to 'leak' out of a > case..end? It is the straightforward extension from the current idea that bindings 'leak' out of a single expression, so you can use the binding later on, for example: X = f(Y), ... g(X) Now you might say "but that's an *assignment* - it's different!" But it's not. "X = f(Y)" is just an expression which happens to contain a variable binding, which is "exported" from the expression and becomes avaliable in the expressions following the ','. So, logically, if an expression (like a 'case') contains alternative branches, the exported bindings from that expression should be those that are exported from each of the branches. (Those that could be undefined in one of the branches are "unsafe", and it *is* a compile time error to use an unsafe variable.) The code above should be a perfect illustration of a "good" use of this form of binding. Simple, straightforward, readable. However, it turned out that in certain programs, this kind of binding tended to introduce errors. Sometimes, you introduce a variable such as 'X' as a temporary variable in a branch of a 'case' (for instance in the clause pattern), and you only intend to use it "locally", but if you use the same name 'X' in *all* the branches, the variable 'X' is suddenly legally exported to the following expressions. What happens next is of course that further below, you use the "local" name 'X' *again*, without realizing that it is already bound to some value. The result is that the later occurrence of 'X' does not become a binding, but a matching, and most likely, you get a runtime 'badmatch' error. The quick fix for this was that the "variable exported" warning was added to the compiler (in the old JAM days). But this made *all* uses of such exported variables trigger a warning. It fixed the problem, but was annoying, since you could no longer use this actual *feature* of the language without getting compiler warnings all over the place. Eventually, I got tired of this and submitted a patch to erl_lint that did a more fine-grained check, so that only repeated occurrences in patterns cause warnings. Thus, the code in the above example does not cause warnings today - there is no reason for a warning there. But code like the following: case ... of {foo, X} -> ...; {bar, X} -> ... end, ... case {fred, X} -> ...; {barney, X} -> ... end causes warnings at the later uses of 'X', because since they occur in a pattern, it is unlikely that the author really means "the same X that was bound above". (It is still just a warning, though, in case you really want to write code like that.) In short: exporting variables from 'case' expressions (and similar) is OK if you just *use* the variables afterwards, but if you put them in patterns you will get warnings. > My language designer's intuition is telling me that the scoping rules > for case..end should be more like those for fun..end. Erlang's variable scoping rules make it sufficiently different to confuse any language designer. The hope is still, I think, that the actual Erlang programmers are helped by them rather than confused. It is after all pretty straightforward to bind variables in Erlang - you don't have to think too hard about writing 'let' statements. There is of course a tradeoff between easy introduction of variables and simple scoping rules. I don't know any other language that has walked this path as far as Erlang. You have to ask yourself as a user whether it's good or bad. /Richard Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://user.it.uu.se/~richardc/ "Having users is like optimization: the wise course is to delay it." -- Paul Graham From kent@REDACTED Mon Jul 21 12:11:31 2003 From: kent@REDACTED (Kent Boortz) Date: 21 Jul 2003 12:11:31 +0200 Subject: Please test snapshots of the coming R9C In-Reply-To: <200307210740.h6L7eLF20679@tessla.levonline.com> References: <200307210740.h6L7eLF20679@tessla.levonline.com> Message-ID: Per Bergqvist writes: > just got back from a weeks vacation and noticed that my patch > has not yet been included in the later snapshots (as least not in > 2003-07-18). > > Is it only due to vacations or do you want it reworked in any way ? It is mainly due to vacations. The orber gcc 3.3 C++ issue will have a simple solution, the file will not be compiled part of the build in R9C-1. The file "lib/orber/c_src/InitialReference.cc" is just an example and if it is used it has to be recompiled and linked with user code. The deveper responsible for the OpenSSL use is on vacation. I can't say if your changes for kerberos and OpenSSL will make it to R9C-1. Is this a serious build problem or a feature? Your changes in erts and erl_interface except erts/config* are now merged and will be in the next snapshot. Thank you for the patches, kent From per@REDACTED Mon Jul 21 11:46:54 2003 From: per@REDACTED (Per Bergqvist) Date: Mon, 21 Jul 2003 12:46:54 +0300 Subject: Please test snapshots of the coming R9C In-Reply-To: Message-ID: <200307211046.h6LAksg24651@tessla.levonline.com> > > The deveper responsible for the OpenSSL use is on vacation. I can't > say if your changes for kerberos and OpenSSL will make it to R9C-1. > Is this a serious build problem or a feature? ssl application will not build on RedHat 9 without the fix. > > Your changes in erts and erl_interface except erts/config* are > now merged and will be in the next snapshot. > Good > Thank you for the patches, > > kent > My pleasure, Per From erlang@REDACTED Tue Jul 22 03:44:48 2003 From: erlang@REDACTED (erlang@REDACTED) Date: Mon, 21 Jul 2003 21:44:48 -0400 (EDT) Subject: Good practice In-Reply-To: from "Richard Carlsson" at Jul 21, 2003 11:42:24 AM Message-ID: > A bit late (hey, it's summer), but I thought I should try to give an > explanation of this behaviour. And greatly appreciated it is! > On Fri, 18 Jul 2003, Chris Pressey wrote: > > On Sun, 8 Jun 2003 17:28:01 -0400 (EDT) > > erlang@REDACTED wrote: > > > bash$ erl > > > Erlang (JAM) emulator version 47.4.1 > > > > > > Eshell V47.4.1 (abort with ^G) > > > 1> c(test1file). > > > ./test1file.erl:172: Warning: variable 'Response' exported from > > > ['case']{ok,test1file} > > > 2> > Wow! JAM version 47.4.1! This is an ancient system. (On the other hand, > that particular compiler warning was not changed until BEAM R7 or R8, so > a lot of other people may also see this warning still.) *ahem* well, yes, you see the thing is I have this ancient hacked up slackware box with broken libs and header files which is in too delicate a state pre migration to a more sensible system on which more recent (BEAM-based) versions will actually compile. Don't ask me why; I'd love to use gs, and I love erlang, but when I think too hard about the rationale behind C's header files and libraries and so on, my head starts to hurt and my cats all hide and my wife tells me to stop screaming before she hits me with her cast iron frying pan ... Anyway, it's what I have to work on for now, until the budget is there for an upgrade, and I can move critical running systems elsewhere so that I can do a clean reinstall. > > > From the file in question: > > > case checkvalid(Funcref, Correctlist) of > > > false -> > > > Response = false; > > > Other -> > > > Response = invoker(Other, Otherargs) > > > end, > > > Requester ! Response, > > I've never actually understood why this isn't a full-fledged error. > > Is there a good reason that bindings are allowed to 'leak' out of a > > case..end? My position was that a case statement is just that; a single statement. A rather convoluted one, but from which I would expect bindings to leak just the same as any other statement. Much to my surprise, judging by the remarks below, it seems to have been the way some other people felt about it ... > It is the straightforward extension from the current idea that bindings > 'leak' out of a single expression, so you can use the binding later on, > for example: > X = f(Y), > ... > g(X) > > Now you might say "but that's an *assignment* - it's different!" > But it's not. "X = f(Y)" is just an expression which happens to > contain a variable binding, which is "exported" from the expression > and becomes avaliable in the expressions following the ','. And more particularly, to my eye, it's occurring in the same function, which suggests to me that it should, intuitively, be the same scope (more or less). > So, logically, if an expression (like a 'case') contains alternative > branches, the exported bindings from that expression should be those > that are exported from each of the branches. (Those that could be > undefined in one of the branches are "unsafe", and it *is* a compile > time error to use an unsafe variable.) I'm glad you wrote the checker to be this careful. Then on the other hand I'm a big, big proponent of very clear code based on the smallest subset of the syntax diagram which will reasonably do what I need. It makes my code more verbose, of course, but that was why the error above puzzled me; I felt that what I was doing was sensible and sane ... > The code above should be a perfect illustration of a "good" use of this > form of binding. Simple, straightforward, readable. ... with which you appear to agree, and thanks for the vote of confidence. > However, it turned out that in certain programs, this kind of binding > tended to introduce errors. Sometimes, you introduce a variable such as > 'X' as a temporary variable in a branch of a 'case' (for instance in the > clause pattern), and you only intend to use it "locally", but if you use > the same name 'X' in *all* the branches, the variable 'X' is suddenly > legally exported to the following expressions. What happens next is of > course that further below, you use the "local" name 'X' *again*, without > realizing that it is already bound to some value. The result is that the > later occurrence of 'X' does not become a binding, but a matching, and > most likely, you get a runtime 'badmatch' error. Yes, the badmatch would make sense then. I'm inclined to think of this, myself, as a nasty case of programmer error, usually a result of poorly chosen variable names. > The quick fix for this was that the "variable exported" warning was > added to the compiler (in the old JAM days). But this made *all* uses of > such exported variables trigger a warning. It fixed the problem, but was > annoying, since you could no longer use this actual *feature* of the > language without getting compiler warnings all over the place. Well, on the other hand, to be entirely fair, when I originally asked the question the responses pointed out some educationally improved ways of actually performing the trick in question (such as pulling it from the case explicitly). [snip description of patch fixing complaints] > In short: exporting variables from 'case' expressions (and similar) is > OK if you just *use* the variables afterwards, but if you put them in > patterns you will get warnings. Here's a deeper question I would like to ask: How do you go about deciding which things are bad practice for erlang programmers which need complaints? The reason I ask is that there are neverending discussions of lint for C and why one should do what it says (or at least understand it) and why that constitutes good practice, however I have yet to see such a discussion in erlang. > > My language designer's intuition is telling me that the scoping rules > > for case..end should be more like those for fun..end. > Erlang's variable scoping rules make it sufficiently different to > confuse any language designer. The hope is still, I think, that the > actual Erlang programmers are helped by them rather than confused. It is > after all pretty straightforward to bind variables in Erlang - you don't > have to think too hard about writing 'let' statements. There is of > course a tradeoff between easy introduction of variables and simple > scoping rules. I don't know any other language that has walked this path > as far as Erlang. You have to ask yourself as a user whether it's good > or bad. I think that erlang's current state is on the right side here. If god meant case statements to have independent variable binding scopes, then dammit, he'd have made them separate functions! Instead they're just selection statements which can go one of several ways. I like to think of erlang (and functional languages in general) as being rather similar to macro assemblers in spirit, where each macro is a function, and what you're passing is register state. Of course, I very hastily don my asbestos suit when saying that, but I also say this because that is how I program assembler, and why I tend to have a low error rate. My asm isn't the fastest on the block, but when I guarantee the entry and exit state of each macro (as far as register state is concerned, anyway), it gets a lot easier to produce working code rather than spaghetti ... but I digress. From richardc@REDACTED Tue Jul 22 10:48:50 2003 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 22 Jul 2003 10:48:50 +0200 (MET DST) Subject: Good practice In-Reply-To: References: Message-ID: On Mon, 21 Jul 2003 erlang@REDACTED wrote: > Here's a deeper question I would like to ask: > > How do you go about deciding which things are bad practice for erlang > programmers which need complaints? The reason I ask is that there are > neverending discussions of lint for C and why one should do what it > says (or at least understand it) and why that constitutes good > practice, however I have yet to see such a discussion in erlang. I suppose that the situation is different with C, because it is a rather low-level systems programming language ("glorified assembler" as some would have it), and programmers need to be able to bend the language into whichever shape they want it in order to make the code fast enough or small enough for their particular purposes and hardware. Since everybody needs to bend the rules in their own special way, there can be no real consensus as to what the compiler should warn you about. In a language like Erlang, the range of possible tricks that can go horribly wrong is just so much smaller. /Richard Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://user.it.uu.se/~richardc/ "Having users is like optimization: the wise course is to delay it." -- Paul Graham From olgeni@REDACTED Tue Jul 22 11:02:34 2003 From: olgeni@REDACTED (Jimmy Olgeni) Date: Tue, 22 Jul 2003 11:02:34 +0200 (CEST) Subject: py_interface-0.91 Message-ID: <20030722110027.B93995@dev1.localdomain.net> Hi, If you're using it, check out this patch. --- erl_term.py.orig Wed May 29 00:09:25 2002 +++ erl_term.py Sat Nov 16 17:40:38 2002 @@ -282,7 +282,7 @@ if dataLen < 5: return (None, data) n = _ReadInt4(data[1:5]) - return (ErlNumber(i), data[5:]) + return (ErlNumber(n), data[5:]) elif data0 == MAGIC_FLOAT: if dataLen < 32: @@ -373,7 +373,7 @@ (elements, remainingData) = _UnpackTermSeq(arity, data[5:]) if elements == None: return (None, data) - return (ErlList(elements), remainingData) + return (ErlList(elements), remainingData[1:]) # skip MAGIC_NIL elif data0 == MAGIC_BINARY: if dataLen < 5: @@ -552,11 +552,11 @@ def _PackString(term): if len(term) == 0: - return PackList([]) + return _PackList([]) elif len(term) <= 65535: return _PackInt1(MAGIC_STRING) + _PackInt2(len(term)) + term else: - return PackList(map(lambda c: ord(c), term)) + return _PackList(map(lambda c: ord(c), term)) def _PackList(term): if len(term) == 0: -- jimmy From D.WILLIAMS@REDACTED Tue Jul 22 11:34:38 2003 From: D.WILLIAMS@REDACTED (WILLIAMS Dominic) Date: Tue, 22 Jul 2003 11:34:38 +0200 Subject: make:all() and load... Message-ID: Hello, I can't get make:all() to reload recompiled files. Here is a simplified example: ./ebin/Emakefile: {'../src/test',[load]}. ./src/test.erl: -module(test). -export([run/0]). run() -> hello. Erlang (BEAM) emulator version 5.2.3.3 [threads:0] Eshell V5.2.3.3 (abort with ^G) 1> cd("c:/erlang/bug/ebin"). c:/erlang/bug/ebin ok 2> make:all(). Recompile: ../src/test up_to_date 3> test:run(). hello Now modify ./src/test.erl: -module(test). -export([run/0]). run() -> goodbye. 4> make:all(). Recompile: ../src/test up_to_date 5> test:run(). hello 6> l(test). {module,test} 7> test:run(). goodbye 8> Why doesn't make:all() load the recompiled module? Am I doing something wrong? Regards, Dominic Williams. From richardc@REDACTED Tue Jul 22 11:43:17 2003 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 22 Jul 2003 11:43:17 +0200 (MET DST) Subject: make:all() and load... In-Reply-To: References: Message-ID: On Tue, 22 Jul 2003, WILLIAMS Dominic wrote: > I can't get make:all() to reload recompiled files. > > 2> make:all(). > Recompile: ../src/test > up_to_date > 3> test:run(). > hello Try: make:all([load]). /Richard Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://user.it.uu.se/~richardc/ "Having users is like optimization: the wise course is to delay it." -- Paul Graham From siri@REDACTED Tue Jul 22 11:44:55 2003 From: siri@REDACTED (Siri Hansen (EAB)) Date: Tue, 22 Jul 2003 11:44:55 +0200 Subject: make:all() and load... In-Reply-To: References: Message-ID: <16157.1943.448779.329974@gargle.gargle.HOWL> 'load' is not a compiler option, it is a make option. Try instead ./ebin/Emakefile: {'../src/test',[]}. and do make:all([load]). /siri WILLIAMS Dominic wrote: > Hello, > > I can't get make:all() to reload recompiled files. > > Here is a simplified example: > > ./ebin/Emakefile: > {'../src/test',[load]}. > > ./src/test.erl: > -module(test). > -export([run/0]). > run() -> > hello. > > Erlang (BEAM) emulator version 5.2.3.3 [threads:0] > Eshell V5.2.3.3 (abort with ^G) > 1> cd("c:/erlang/bug/ebin"). > c:/erlang/bug/ebin > ok > 2> make:all(). > Recompile: ../src/test > up_to_date > 3> test:run(). > hello > > Now modify ./src/test.erl: > -module(test). > -export([run/0]). > run() -> > goodbye. > > 4> make:all(). > Recompile: ../src/test > up_to_date > 5> test:run(). > hello > 6> l(test). > {module,test} > 7> test:run(). > goodbye > 8> > > Why doesn't make:all() load the recompiled module? > Am I doing something wrong? > > Regards, > > Dominic Williams. From D.WILLIAMS@REDACTED Tue Jul 22 14:12:24 2003 From: D.WILLIAMS@REDACTED (WILLIAMS Dominic) Date: Tue, 22 Jul 2003 14:12:24 +0200 Subject: make:all() and load... Message-ID: > Try: > > make:all([load]). Thanks Richard and Siri, that does the trick of course. Dominic. From hal@REDACTED Tue Jul 22 19:42:01 2003 From: hal@REDACTED (Hal Snyder) Date: Tue, 22 Jul 2003 12:42:01 -0500 Subject: SNMP tutorial Message-ID: <87y8yqzceu.fsf@ghidra.vail> Here is a quick tutorial on making Mnesia tables SNMP accessible. There is of course Chapter 6 of Ericsson's "Erlang/OTP SNMP User's Guide" - the page above just gives a tiny example from start to finish. Feedback is welcome. http://www.drxyzzy.org/mnesia-snmp/ From erlang@REDACTED Tue Jul 22 21:18:02 2003 From: erlang@REDACTED (Erlang Questions) Date: Tue, 22 Jul 2003 16:18:02 -0300 Subject: Accessing windows net from erlsrv Message-ID: <005c01c35085$f979d710$2100a8c0@mnesia> Hi, has someone passed through this before? I want to access a file located on a mapped net drive from Erlang using file module and running Erlang as a windows service (erlsrv). When the mapped drive is not a local directory Erlang (or Windows) could not solve the access. I have tried six different ways with different results: Local folder mapped - running erl -> 1> file:open("f:/pru.txt", [write]). {ok,IoDevice} Net folder mapped - running erl -> (when the mapped drive is a Windows 2000) 2> file:open("g:/pru.txt", [write]). {ok,IoDevice} Net folder mapped - running erl -> (when the mapped drive is a Novell) 3> file:open("z:/pru.txt", [write]). {ok,IoDevice} Local folder mapped - running erlsrv -> 4> file:open("f:/pru.txt", [write]). {ok,IoDevice} Net folder mapped - running erlsrv -> (when the mapped drive is a Windows 2000) 5> file:open("g:/pru.txt", [write]). {error,eacces} Net folder mapped - running erlsrv -> (when the mapped drive is a Novell) 6> file:open("z:/pru.txt", [write]). {error,einval} I need to access a Novell (case 6) My doubt is what's the difference between case 3 and 6, if the difference is in Erlang and how can I solve this. Do you know a way to resolve this? I would appreciate any suggestion. Thanks, Carlos.- -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Wed Jul 23 02:40:25 2003 From: erlang@REDACTED (erlang@REDACTED) Date: Tue, 22 Jul 2003 20:40:25 -0400 (EDT) Subject: Good practice In-Reply-To: from "Richard Carlsson" at Jul 22, 2003 10:48:50 AM Message-ID: > I suppose that the situation is different with C, because it is a rather > low-level systems programming language ("glorified assembler" as some > would have it), and programmers need to be able to bend the language > into whichever shape they want it in order to make the code fast enough > or small enough for their particular purposes and hardware. Since > everybody needs to bend the rules in their own special way, there can be > no real consensus as to what the compiler should warn you about. In a > language like Erlang, the range of possible tricks that can go horribly > wrong is just so much smaller. Actually, here I'd like to make something of a philosophical point... Yes, C is debased assembler (IMHO, I think that C's syntax is messy, and a decently written piece of assembler is frequently more readable than most C, but I realise that I'm in the minority here so I won't press the point) but there's quite another way of regarding erlang in this context. I think erlang is a systems language. Erlang is, in fact, a pretty darned low level systems language. Also, again IMHO, a very elegant one. It just happens to be a systems language for a virtual machine, along with a networking language for a network of such virtual machines, in a virtualised networking environment. The corollary is of course that one could perfectly well write a useful, meaningful OS in Erlang, for using the BEAM virtual system as one's application platform. Efficient? Not particularly, in the big picture. Desirable? .... just possibly. I think it could well be desirable. As an example of something along those lines, I would offer Inferno. The tricky part would be deciding what you wanted in such an OS, and how to secure it, given Erlang's rather open-ended design. From per@REDACTED Wed Jul 23 10:16:37 2003 From: per@REDACTED (Per Bergqvist) Date: Wed, 23 Jul 2003 11:16:37 +0300 Subject: Please test snapshots of the coming R9C In-Reply-To: <200307211046.h6LAksg24651@tessla.levonline.com> Message-ID: <200307230916.h6N9Gbk16981@tessla.levonline.com> Hi, Attached is a small patch relative the 2003-07-22 snapshot. It fixes: 1) strict-aliasing warning in erl_bif_port.c 2) a couple of prototype warnings in unix/sys.c 3) initialize a sigaction struct properly. /Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED -------------- next part -------------- A non-text attachment was scrubbed... Name: otp_src_P9C_2003-07-22.patch Type: application/octet-stream Size: 5034 bytes Desc: not available URL: From rvg@REDACTED Wed Jul 23 11:34:51 2003 From: rvg@REDACTED (Rudolph van Graan) Date: Wed, 23 Jul 2003 11:34:51 +0200 Subject: Accessing windows net from erlsrv Message-ID: <1F42BB97D787C048BCC519FF28048AC367F0@na.sdn.net.za> Hi, My guess at the reason for this is that erlsrv is running as the windows system account [unless setup otherwise]. This account would IMO not by default have access to mapped folders [Which are only visible if you are physically logged on as the interactive user]. Specify the path differently, probably using UNC path names. I cannot remember how to do this with netware, but on windows you would do something like: file:open("//some_server.some_domain/some_share/some_file",[write]). Rgds, R -----Original Message----- From: Erlang Questions [mailto:erlang@REDACTED] Sent: 22 July 2003 09:18 PM To: Erlang Questions Subject: Accessing windows net from erlsrv Hi, has someone passed through this before? I want to access a file located on a mapped net drive from Erlang using file module and running Erlang as a windows service (erlsrv). When the mapped drive is not a local directory Erlang (or Windows) could not solve the access. I have tried six different ways with different results: Local folder mapped - running erl -> 1> file:open("f:/pru.txt", [write]). {ok,IoDevice} Net folder mapped - running erl -> (when the mapped drive is a Windows 2000) 2> file:open("g:/pru.txt", [write]). {ok,IoDevice} Net folder mapped - running erl -> (when the mapped drive is a Novell) 3> file:open("z:/pru.txt", [write]). {ok,IoDevice} Local folder mapped - running erlsrv -> 4> file:open("f:/pru.txt", [write]). {ok,IoDevice} Net folder mapped - running erlsrv -> (when the mapped drive is a Windows 2000) 5> file:open("g:/pru.txt", [write]). {error,eacces} Net folder mapped - running erlsrv -> (when the mapped drive is a Novell) 6> file:open("z:/pru.txt", [write]). {error,einval} I need to access a Novell (case 6) My doubt is what's the difference between case 3 and 6, if the difference is in Erlang and how can I solve this. Do you know a way to resolve this? I would appreciate any suggestion. Thanks, Carlos.- -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Wed Jul 23 15:07:12 2003 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 23 Jul 2003 09:07:12 -0400 Subject: Accessing windows net from erlsrv References: <1F42BB97D787C048BCC519FF28048AC367F0@na.sdn.net.za> Message-ID: <3F1E8880.9030407@hq.idt.net> Rudolph is correct, but I'd like to add that unless the a windows service is running under an account that has network access, UNC paths wouldn't likely be accessible from your app. Configure erlsrv to run under some specific account other than local admin, and try the UNC approach. Serge Rudolph van Graan wrote: > Hi, > > My guess at the reason for this is that erlsrv is running as the windows > system account [unless setup otherwise]. This account would IMO not by > default have access to mapped folders [Which are only visible if you are > physically logged on as the interactive user]. Specify the path > differently, probably using UNC path names. I cannot remember how to do > this with netware, but on windows you would do something like: > > file:open("//some_server.some_domain/some_share/some_file",[write]). > > Rgds, > > R > > -----Original Message----- > From: Erlang Questions [mailto:erlang@REDACTED] > Sent: 22 July 2003 09:18 PM > To: Erlang Questions > Subject: Accessing windows net from erlsrv > > Hi, has someone passed through this before? > > I want to access a file located on a mapped net drive from Erlang > using file module and running Erlang as a windows service (erlsrv). > When the mapped drive is not a local directory Erlang (or Windows) > could not solve the access. > I have tried six different ways with different results: > > Local folder mapped - running erl -> > 1> file:open("f:/pru.txt", [write]). > {ok,IoDevice} > > Net folder mapped - running erl -> (when the mapped drive is a > Windows 2000) > 2> file:open("g:/pru.txt", [write]). > {ok,IoDevice} > > Net folder mapped - running erl -> (when the mapped drive is a Novell) > 3> file:open("z:/pru.txt", [write]). > {ok,IoDevice} > > Local folder mapped - running erlsrv -> > 4> file:open("f:/pru.txt", [write]). > {ok,IoDevice} > > Net folder mapped - running erlsrv -> (when the mapped drive is a > Windows 2000) > 5> file:open("g:/pru.txt", [write]). > {error,eacces} > > Net folder mapped - running erlsrv -> (when the mapped drive is a > Novell) > 6> file:open("z:/pru.txt", [write]). > {error,einval} > > I need to access a Novell (case 6) > My doubt is what's the difference between case 3 and 6, if the > difference is in Erlang and how can I solve this. > > Do you know a way to resolve this? > I would appreciate any suggestion. > > Thanks, Carlos.- > From mike@REDACTED Wed Jul 23 16:53:32 2003 From: mike@REDACTED (Mike Williams) Date: 23 Jul 2003 14:53:32 GMT Subject: Tutorial Message-ID: I have written a tutorial covering most of the basics of Erlang. OTP is not covered. This is not a specification of Erlang, rather a text which will hopefully help to get people started. A specification is being written separately (by Gunnila Arendt) and when this is ready, this tutorial I hope to addend the tutorial to cross reference the spec. The tutorial is available at: http://www.erlang.org/doc/misc/tut.txt and is a plain text file. All the example programs can be copy / pasted from this files and be compiled and run. What I would like now are comments, errata and sugestions for improvements. /mike From gerd@REDACTED Wed Jul 23 17:38:43 2003 From: gerd@REDACTED (Gerd Flaig) Date: Wed, 23 Jul 2003 17:38:43 +0200 Subject: Erlang and Aculab Message-ID: Hi, is anybody here using Erlang to drive Aculab Telephony hardware? I would be interested how you integrated it - as a linked-in driver, external port binaries with stdio protocol, ...? We use the latter variant and I would like to know if somebody else has also written an interface and how it is structured. Goodbyte, Gerd. -- Gerd Flaig Technik gerd@REDACTED Bei Schlund + Partner AG Brauerstra?e 48 D-76135 Karlsruhe Physics is like sex: sure, it may give some practical results, but that's not why we do it. -- Richard Feynman From per@REDACTED Wed Jul 23 16:58:02 2003 From: per@REDACTED (Per Bergqvist) Date: Wed, 23 Jul 2003 17:58:02 +0300 Subject: Erlang and Aculab In-Reply-To: Message-ID: <200307231558.h6NFw2K26049@tessla.levonline.com> I implemented a couple a versions in ancient times (like 1991-2 :-). At that time neither linked in drivers nor did aculab support a select interface so it was implemented as external port programs. If aculab nowadays support select/poll I would implement it as a linked in driver. /Per ------------------- > Hi, > > is anybody here using Erlang to drive Aculab Telephony hardware? I > would be interested how you integrated it - as a linked-in driver, > external port binaries with stdio protocol, ...? > > We use the latter variant and I would like to know if somebody else > has also written an interface and how it is structured. > > Goodbyte, Gerd. > -- > Gerd Flaig Technik gerd@REDACTED > Bei Schlund + Partner AG Brauerstra?e 48 D-76135 Karlsruhe > Physics is like sex: sure, it may give some practical results, > but that's not why we do it. -- Richard Feynman > ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From kent@REDACTED Wed Jul 23 18:03:29 2003 From: kent@REDACTED (Kent Boortz) Date: 23 Jul 2003 18:03:29 +0200 Subject: Win32 binary installer snapshot Message-ID: There are now snapshots from the Windows build, i.e. you can download an installer that installs Erlang OTP without the need for you to compile from sources. http://www.erlang.org/download/snapshots/ Please try it out and let us know if there are any problems. There is a known problem. Currently the Tcl/Tk wish program is not distributed with the gs application. This means that gs and graphical tools will not work unless you have Tcl/Tk 8.2 or later installed separately on your system, The OTP team From cpressey@REDACTED Wed Jul 23 20:22:38 2003 From: cpressey@REDACTED (Chris Pressey) Date: Wed, 23 Jul 2003 13:22:38 -0500 Subject: BSD Firewall (long) In-Reply-To: <4.2.2.20030709220455.00d01220@duomark.com> References: <4.2.2.20030709220455.00d01220@duomark.com> Message-ID: <20030723132238.4f0d5c92.cpressey@catseye.mb.ca> On Wed, 09 Jul 2003 22:46:12 -0700 Jay Nelson wrote: > The thing I like best about OpenBSD is that it feels smaller than > Linux and that most things are controlled by a single configuration > file. [...] Sorry this is a bit late, but on the subject of BSD's, Matt Dillon has recently created a fork of FreeBSD called DragonFlyBSD. I mention it here because while browsing the website I was struck by the similarity, in some important aspects, to Erlang: - lightweight processes - preferred IPC mechanism is asynch message passing - preferred mechanism for communicating arguments is tagged lists It probably won't be a workable OS for another few years, but if you're interested in watching it take shape, check out: http://www.dragonflybsd.org/ -Chris From richardc@REDACTED Wed Jul 23 21:20:57 2003 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 23 Jul 2003 21:20:57 +0200 Subject: BSD Firewall (long) References: <4.2.2.20030709220455.00d01220@duomark.com> <20030723132238.4f0d5c92.cpressey@catseye.mb.ca> Message-ID: <001101c3514f$8e825c00$51ddd1d9@gnit> Is this the same Matt Dillon who wrote the DICE C compiler integrated environment for the dear old Amiga, a long time ago? In that case, it seems that these ideas actually come from the Amiga OS (I'm not saying that's where they originated, though). /Richard ----- Original Message ----- From: "Chris Pressey" To: "Erlang-Questions" Sent: Wednesday, July 23, 2003 8:22 PM Subject: Re: BSD Firewall (long) > Sorry this is a bit late, but on the subject of BSD's, Matt Dillon has > recently created a fork of FreeBSD called DragonFlyBSD. I mention it > here because while browsing the website I was struck by the similarity, > in some important aspects, to Erlang: > > - lightweight processes > - preferred IPC mechanism is asynch message passing > - preferred mechanism for communicating arguments is tagged lists From taavi@REDACTED Wed Jul 23 23:08:17 2003 From: taavi@REDACTED (Taavi Talvik) Date: Thu, 24 Jul 2003 00:08:17 +0300 (EEST) Subject: BSD Firewall (long) In-Reply-To: <001101c3514f$8e825c00$51ddd1d9@gnit> Message-ID: <20030724000724.O10977-100000@valu.uninet.ee> On Wed, 23 Jul 2003, Richard Carlsson wrote: > Is this the same Matt Dillon who wrote the DICE C compiler > integrated environment for the dear old Amiga, a long time ago? > In that case, it seems that these ideas actually come from the > Amiga OS (I'm not saying that's where they originated, though). Yes, he is the same Matt Dillon. best regards, taavi From Marc.Vanwoerkom@REDACTED Wed Jul 23 23:15:18 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Wed, 23 Jul 2003 23:15:18 +0200 (MEST) Subject: BSD Firewall (long) In-Reply-To: <001101c3514f$8e825c00$51ddd1d9@gnit> (richardc@csd.uu.se) Message-ID: <200307232115.h6NLFIR15200@bonsai.fernuni-hagen.de> > Is this the same Matt Dillon who wrote the DICE C compiler > integrated environment for the dear old Amiga, a long time ago? Yes, if I remember right, he put the sources on his home page. Regards, Marc From per@REDACTED Thu Jul 24 06:36:46 2003 From: per@REDACTED (Per Bergqvist) Date: Thu, 24 Jul 2003 07:36:46 +0300 Subject: Erlang and Aculab In-Reply-To: Message-ID: <200307240536.h6O5akI11404@tessla.levonline.com> Hi, > > call events still come in via a blocking ioctl()... :/ > Then you have two alternatives: 1) External port program 2) Multithreaded linked in driver with a separate wait thread handling the board communication. > Did you have no problems with wild pointers in their code? Early > versions of my interface sometimes broke with obscure errors hinting > at the library shooting holes in the program. It got a lot better when > the interface was broken down to lots of processes with their own > memory space. > We had similiar problems, but as I said this was ages ago. I have implemented erlang interfaces for Aculab, NMS and Dialogic hardware. In my opinion Dialogic (now Intel) was the best vendor but that was absolutely not without flaws. It is possible to write a linked in driver for dialogic (but one need to find the multiplex fd by scanning). My favourite nowadays for CT is Corelatus (http://www.corelatus.com) and their GTH box. It is great stuff if you roll your own call control (or use third party). /Per > Goodbyte, Gerd. > -- > Gerd Flaig Technik gerd@REDACTED > Bei Schlund + Partner AG Brauerstra?e 48 D-76135 Karlsruhe > Physics is like sex: sure, it may give some practical results, > but that's not why we do it. -- Richard Feynman > ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From per@REDACTED Thu Jul 24 07:52:24 2003 From: per@REDACTED (Per Bergqvist) Date: Thu, 24 Jul 2003 08:52:24 +0300 Subject: Please test snapshots of the coming R9C In-Reply-To: <200307211046.h6LAksg24651@tessla.levonline.com> Message-ID: <200307240652.h6O6qOK12892@tessla.levonline.com> Hi Kent, Just to reiterate, the ssl application does not build on RedHat 9 without the kerberos 5 check. Attached is a patch file with only this check. The only thing the patch does is that it will include the path to the kerberos header files, why not simply merge it ? /Per ------------------- > > > > The deveper responsible for the OpenSSL use is on vacation. I can't > > say if your changes for kerberos and OpenSSL will make it to R9C-1. > > Is this a serious build problem or a feature? > > ssl application will not build on RedHat 9 without the fix. > > > > > Your changes in erts and erl_interface except erts/config* are > > now merged and will be in the next snapshot. > > Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED -------------- next part -------------- A non-text attachment was scrubbed... Name: otp_src_P9C_2003-07-22.patch_krb5 Type: application/octet-stream Size: 1684 bytes Desc: not available URL: From bjorn@REDACTED Thu Jul 24 10:23:27 2003 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 24 Jul 2003 10:23:27 +0200 Subject: Mac OS X problems (was: Please test...) In-Reply-To: <0C540D19-B39A-11D7-9CA4-000A95927CCE@mac.com> References: <0C540D19-B39A-11D7-9CA4-000A95927CCE@mac.com> Message-ID: There seems that on Mac OS X, you sometimes need to add the -lbundle1.o flat to the link flags ('-bundle' by itself doesn't seem to be enough). In today's snapshot of R9C the '-lbundle1.o' will be include in the link flags (for Mac OS X). I have not tested that this particular snapshot resolves the ASN1 problems (I don't have a Mac at work, only at home), but the '-lbundle1.o' fix applied to an earlier snapshot did work. /Bjorn Sean Hinde writes: > On Wednesday, July 9, 2003, at 05:12 pm, Kent Boortz wrote: > > > > > It is now less than a month to the R9C release. The code is frozen but > > we are still doing some testing, adding some missing documentation and > > release notes. > > > > The compile of the asn1 driver under OS X still tries to use ld for > the final link stage resulting in: > > dyld: /Users/sean/R9C-0/lib/erlang/erts-2003.07.11/bin/beam Undefined > symbols: > dyld_stub_binding_helper > Trace/BPT trap > > > and an emulator crash when calling asn1rt:load-driver(). > > The fix is to use gcc for the final link stage. > > The same problem exists in trace_ip_drv and trace_file_drv. > > megaco_flex_scanner DOES work :) > > Sean > -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From luca.manai@REDACTED Thu Jul 24 12:29:59 2003 From: luca.manai@REDACTED (Luca Manai (=?iso-8859-1?Q?=C4V=2FEAB?=)) Date: Thu, 24 Jul 2003 12:29:59 +0200 Subject: start or re-start? Message-ID: <3F1FB527.91B17724@ericsson.com> Hello all, is there the possibility for a child process to distiguish between the two following situations? [1] the supervisor has started the child for the first time (start_child/2 interface) [2] the supervisor has re-started the child (child process crash) I couldn't come up up with a clean solution... (I don't need to distiguish the restart_child/2 situation) Thanks. Luca. -- Luca Manai mailto:luca.manai@REDACTED ERICSSON AB - PDU IP Connectivity and Control G?talandsv?gen, 230 - SE-12544 ?lvsj? - Sweden Tel. +46 (0)8 71 94071 - Fax. +46 (0)8 71 99940 From kent@REDACTED Thu Jul 24 16:55:50 2003 From: kent@REDACTED (Kent Boortz) Date: 24 Jul 2003 16:55:50 +0200 Subject: Please test snapshots of the coming R9C In-Reply-To: <200307240652.h6O6qOK12892@tessla.levonline.com> References: <200307240652.h6O6qOK12892@tessla.levonline.com> Message-ID: Per Bergqvist writes: > Hi Kent, > > Just to reiterate, the ssl application does not build on RedHat 9 > without the kerberos 5 check. > > Attached is a patch file with only this check. > > The only thing the patch does is that it will include the path to > the kerberos header files, why not simply merge it ? I haven't had time to look at the patch, I'm just trying to be careful. I'm sure the patch is correct but from a quick look at it to me it looks like the test will prefer krb5.h in "/usr/kerberos/include" over "$SSL_ROOT/include" if the file was found in both locations (missing break out of loop?). Is this what you intended? Don't we also need to find the lib that matches the header file? Or isn't the kerberos lib needed by the resulting binaries? I try to use the same standard and carefulness merging parts only used by OpenSource and what is used for the commercial builds but I'm probably too careful. The patch will not change our builds for our commercial customers so it is now merged. Sorry about the delay. I don't mean to be negative, we really appreciate the patches we get, kent From mlogan@REDACTED Thu Jul 24 17:04:25 2003 From: mlogan@REDACTED (Martin J. Logan) Date: 24 Jul 2003 10:04:25 -0500 Subject: start or re-start? In-Reply-To: <3F1FB527.91B17724@ericsson.com> References: <3F1FB527.91B17724@ericsson.com> Message-ID: <1059059065.31247.54.camel@dhcp-lom-194-186.futuresource.com> I encountered a situation where I needed to distinguish between the start and restart for a given process. The solution that I came up with was to register with an event_handler with the name of my process in my init function. The registration function called in init had the side effect of linking the calling process to the event_manager/handler. When any such registered process would die the exit signal would be caught and the event_handler would then indicate via the next call to its register function that this is not the first time this registration has been made. The return value of register would also provide the reason for the last death. It worked reasonably well in lieu of having the supervisor keep track of exits and restarts. Hope this helps. Cheers, Martin On Thu, 2003-07-24 at 05:29, Luca Manai wrote: > Hello all, > > is there the possibility for a child process to distiguish between > the two following situations? > > [1] the supervisor has started the child for the first time > (start_child/2 interface) > > [2] the supervisor has re-started the child > (child process crash) > > I couldn't come up up with a clean solution... > (I don't need to distiguish the restart_child/2 situation) > > Thanks. > > Luca. From eduardo@REDACTED Thu Jul 24 16:22:18 2003 From: eduardo@REDACTED (Eduardo Figoli) Date: Thu, 24 Jul 2003 16:22:18 +0200 Subject: Application as a service Message-ID: <004c01c351ee$fe695c90$1e00a8c0@design> Is it necessary to use " -mode embedded " flag to run an application as a service ? Does someone know the benfits of embedded and interactive mode ? Thanks, Eduardo Figoli INSwitch Solutions -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.wiger@REDACTED Fri Jul 25 00:07:40 2003 From: ulf.wiger@REDACTED (Wiger Ulf) Date: Fri, 25 Jul 2003 00:07:40 +0200 Subject: start or re-start? References: <3F1FB527.91B17724@ericsson.com> Message-ID: <001b01c35230$00617280$fd7a40d5@telia.com> A fairly simple solution is to create a named ets table in the start function (before spawning the child), and then writing something, perhaps a counter, in it in the child's init function. Since the table is created before spawning the child, it will be owned by the supervisor, and survive a child restart. I don't know if it qualifies as a clean solution. I once wrote a version of supervisor.erl that allowed the child to recall a history of restarts, including finding out about escalated restarts. It didn't make it into OTP, perhaps partly because few people could imagine a pressing need for it. /Uffe ----- Original Message ----- From: "Luca Manai (?V/EAB)" To: Sent: den 24 juli 2003 12:29 Subject: start or re-start? > Hello all, > > is there the possibility for a child process to distiguish between > the two following situations? > > [1] the supervisor has started the child for the first time > (start_child/2 interface) > > [2] the supervisor has re-started the child > (child process crash) > > I couldn't come up up with a clean solution... > (I don't need to distiguish the restart_child/2 situation) > > Thanks. > > Luca. > -- > Luca Manai mailto:luca.manai@REDACTED > > ERICSSON AB - PDU IP Connectivity and Control > G?talandsv?gen, 230 - SE-12544 ?lvsj? - Sweden > Tel. +46 (0)8 71 94071 - Fax. +46 (0)8 71 99940 From vances@REDACTED Fri Jul 25 01:28:00 2003 From: vances@REDACTED (Vance Shipley) Date: Thu, 24 Jul 2003 19:28:00 -0400 Subject: Application as a service In-Reply-To: <004c01c351ee$fe695c90$1e00a8c0@design> References: <004c01c351ee$fe695c90$1e00a8c0@design> Message-ID: <20030724232800.GW17320@frogman.motivity.ca> On Thu, Jul 24, 2003 at 04:22:18PM +0200, Eduardo Figoli wrote: } } Is it necessary to use " -mode embedded " flag to run an } application as a service ? Eduardo, No, it is not. It affects only the code loading strategy used. Once the code is loaded it will run the same in either case. If you use this flag every module installed will be loaded at startup. This spells trouble if you haven't pruned the system to only include those modules which you will actually use, memory use will go through the roof. -Vance } Does someone know the benfits of embedded and interactive mode ? I guess if you use embedded the response time of the system would be consistent whereas if you use interactive the first time a module is referenced it would take slightly longer as the code must be loaded first. -Vance From twanvds@REDACTED Fri Jul 25 03:50:19 2003 From: twanvds@REDACTED (Twan van der Schoot) Date: Fri, 25 Jul 2003 03:50:19 +0200 Subject: Accessing windows net from erlsrv In-Reply-To: <3F1E8880.9030407@hq.idt.net> Message-ID: I'm afraid that it is even worse. Most services run under the local SYSTEM account which is has even more privileges than the standard (local) Administrator account. Eventhough one can trust Erlang stuff to a large extend, the fact that it has connections with the outside world makes it a possible security loophole if you let erlsrv run as a service under the SYSTEM account. Please do use a special user. Note, Even Microsoft (implicity) suggests that you should run MS SQL Server and MS MQ under special user accounts rather than using SYSTEM. regard Twan > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Serge Aleynikov > Sent: woensdag 23 juli 2003 15:07 > To: Erlang Questions > Cc: Rudolph van Graan; Erlang Questions > Subject: Re: Accessing windows net from erlsrv > > > Rudolph is correct, but I'd like to add that unless the a windows > service is running under an account that has network access, UNC paths > wouldn't likely be accessible from your app. > > Configure erlsrv to run under some specific account other than local > admin, and try the UNC approach. > > Serge > > Rudolph van Graan wrote: > > Hi, > > > > My guess at the reason for this is that erlsrv is running as > the windows > > system account [unless setup otherwise]. This account would IMO not by > > default have access to mapped folders [Which are only visible > if you are > > physically logged on as the interactive user]. Specify the path > > differently, probably using UNC path names. I cannot remember how to do > > this with netware, but on windows you would do something like: > > > > file:open("//some_server.some_domain/some_share/some_file",[write]). > > > > Rgds, > > > > R > > > > -----Original Message----- > > From: Erlang Questions [mailto:erlang@REDACTED] > > Sent: 22 July 2003 09:18 PM > > To: Erlang Questions > > Subject: Accessing windows net from erlsrv > > > > Hi, has someone passed through this before? > > > > I want to access a file located on a mapped net drive from Erlang > > using file module and running Erlang as a windows service (erlsrv). > > When the mapped drive is not a local directory Erlang (or Windows) > > could not solve the access. > > I have tried six different ways with different results: > > > > Local folder mapped - running erl -> > > 1> file:open("f:/pru.txt", [write]). > > {ok,IoDevice} > > > > Net folder mapped - running erl -> (when the mapped drive is a > > Windows 2000) > > 2> file:open("g:/pru.txt", [write]). > > {ok,IoDevice} > > > > Net folder mapped - running erl -> (when the mapped drive > is a Novell) > > 3> file:open("z:/pru.txt", [write]). > > {ok,IoDevice} > > > > Local folder mapped - running erlsrv -> > > 4> file:open("f:/pru.txt", [write]). > > {ok,IoDevice} > > > > Net folder mapped - running erlsrv -> (when the mapped drive is a > > Windows 2000) > > 5> file:open("g:/pru.txt", [write]). > > {error,eacces} > > > > Net folder mapped - running erlsrv -> (when the mapped drive is a > > Novell) > > 6> file:open("z:/pru.txt", [write]). > > {error,einval} > > > > I need to access a Novell (case 6) > > My doubt is what's the difference between case 3 and 6, if the > > difference is in Erlang and how can I solve this. > > > > Do you know a way to resolve this? > > I would appreciate any suggestion. > > > > Thanks, Carlos.- > > > > > > From cpressey@REDACTED Fri Jul 25 05:22:32 2003 From: cpressey@REDACTED (Chris Pressey) Date: Thu, 24 Jul 2003 22:22:32 -0500 Subject: BSD Firewall (long) In-Reply-To: <001101c3514f$8e825c00$51ddd1d9@gnit> References: <4.2.2.20030709220455.00d01220@duomark.com> <20030723132238.4f0d5c92.cpressey@catseye.mb.ca> <001101c3514f$8e825c00$51ddd1d9@gnit> Message-ID: <20030724222232.325c8935.cpressey@catseye.mb.ca> On Wed, 23 Jul 2003 21:20:57 +0200 "Richard Carlsson" wrote: > Is this the same Matt Dillon who wrote the DICE C compiler > integrated environment for the dear old Amiga, a long time ago? > In that case, it seems that these ideas actually come from the > Amiga OS (I'm not saying that's where they originated, though). > > /Richard Yep - but that's a good thing, right? It may receive messages by way of ports instead of patterns, but it's still a lot closer to the ideals of solid engineering that're behind Erlang, than any other BSD I've seen. -Chris From per@REDACTED Fri Jul 25 06:57:10 2003 From: per@REDACTED (Per Bergqvist) Date: Fri, 25 Jul 2003 07:57:10 +0300 Subject: Please test snapshots of the coming R9C In-Reply-To: Message-ID: <200307250557.h6P5vAV08314@tessla.levonline.com> Hi, > careful. I'm sure the patch is correct but from a quick look at it to > me it looks like the test will prefer krb5.h in > "/usr/kerberos/include" over "$SSL_ROOT/include" if the file was found > in both locations (missing break out of loop?). Is this what you > intended? Don't we also need to find the lib that matches the header > file? Or isn't the kerberos lib needed by the resulting binaries? > Yes, you are right, a break would be good. Added in the attached patch. The ssl_esock program works without linking with any kerberos libraries. I've been crawling the net to figure out if and which libraries the Kerberos support in OpenSSL actually requires. Only to get more confused. I decided to simply ignore them since it works. Can some of our hardcore Open SSL hackers on the list comment on Open SSL and Kerberos cipher suites (RFC2712) ? /Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED -------------- next part -------------- A non-text attachment was scrubbed... Name: otp_src_P9C_2003-07-23.patch_krb5 Type: application/octet-stream Size: 1705 bytes Desc: not available URL: From bjorn@REDACTED Fri Jul 25 16:31:03 2003 From: bjorn@REDACTED (=?ISO-8859-15?Q?Bj=F6rn_Bylander?=) Date: Fri, 25 Jul 2003 16:31:03 +0200 Subject: Catch not found - abnormal program termination Message-ID: <3F213F27.9000909@loxysoft.se> Hi, Given the module below and the function call "test_srv:start_link(foo)." from the Erlang shell, why does Erlang crash with "Catch not found"? It crashes for me under v5.2.3.3, Linux on an x86 and under v5.2, Windows 2000. Can anyone else reproduce it? Bj?rn Bylander -module(test_srv). -behaviour(gen_server). -export([start_link/1]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). start_link(Param) -> gen_server:start_link(?MODULE, Param, []). init(Param) -> process_flag(trap_exit, true), (catch begin foo(Param), (catch exit(bar)) end ), ignore. foo(_) -> ok. handle_call(Call, From, State) -> {noreply, State}. handle_cast(Msg, State) -> {noreply, State}. handle_info(Msg, State) -> {noreply, State}. terminate(Reason, State) -> ok. code_change(OldVsn, State, Extra) -> {ok, State}. From sean.hinde@REDACTED Fri Jul 25 19:37:54 2003 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 25 Jul 2003 18:37:54 +0100 Subject: Mac OS X problems (was: Please test...) In-Reply-To: Message-ID: > There seems that on Mac OS X, you sometimes need to add the > > -lbundle1.o > > flat to the link flags ('-bundle' by itself doesn't seem to be enough). > In my case I followed the guidelines in the top level README of Erlang/OTP, which exactly mirrors the OS X documentation, and it works perfectly. I would be a bit concerned about using non-standard ways of linking shared libs for OS X. Extract of OTP README follows: "If you develop linked in drivers (shared library) you need to link using "cc" and the flags "-bundle -flat_namespace -undefined suppress". You also include "-fno-common" in CFLAGS when compiling. Use ".so" as the library suffix." Sean > In today's snapshot of R9C the '-lbundle1.o' will be include in the > link flags (for Mac OS X). I have not tested that this particular > snapshot resolves the ASN1 problems (I don't have a Mac at work, only > at home), but the '-lbundle1.o' fix applied to an earlier snapshot > did work. > > /Bjorn > > Sean Hinde writes: > >> On Wednesday, July 9, 2003, at 05:12 pm, Kent Boortz wrote: >> >>> >>> It is now less than a month to the R9C release. The code is frozen >>> but >>> we are still doing some testing, adding some missing documentation >>> and >>> release notes. >>> >> >> The compile of the asn1 driver under OS X still tries to use ld for >> the final link stage resulting in: >> >> dyld: /Users/sean/R9C-0/lib/erlang/erts-2003.07.11/bin/beam Undefined >> symbols: >> >> dyld_stub_binding_helper >> Trace/BPT trap >> >> >> and an emulator crash when calling asn1rt:load-driver(). >> >> The fix is to use gcc for the final link stage. >> >> The same problem exists in trace_ip_drv and trace_file_drv. >> >> megaco_flex_scanner DOES work :) >> >> Sean >> > > -- > Bj?rn Gustavsson Ericsson Utvecklings AB > bjorn@REDACTED ?T2/UAB/F/P > BOX 1505 > +46 8 727 56 87 125 25 ?lvsj? From thomasl_erlang@REDACTED Fri Jul 25 20:42:29 2003 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 25 Jul 2003 11:42:29 -0700 (PDT) Subject: Catch not found - abnormal program termination In-Reply-To: <3F213F27.9000909@loxysoft.se> Message-ID: <20030725184229.59557.qmail@web41901.mail.yahoo.com> --- Bj?rn_Bylander wrote: > Hi, > > Given the module below and the function call > "test_srv:start_link(foo)." > from the Erlang shell, why does Erlang crash with > "Catch not found"? > It crashes for me under v5.2.3.3, Linux on an x86 > and under v5.2, > Windows 2000. > Can anyone else reproduce it? Running your code under RedHat 8, v5.2.3.3, I get nearly the same result: "Catch not foundAbort" Best, Thomas __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From Marc.Vanwoerkom@REDACTED Fri Jul 25 23:33:01 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Fri, 25 Jul 2003 23:33:01 +0200 (MEST) Subject: Me ICFP 2003 stuff.. Message-ID: <200307252133.h6PLX1Z29898@bonsai.fernuni-hagen.de> Here is my write up regarding this year's ICFP programming contest: http://www.stud.fernuni-hagen.de/q5480035/icfp2003 I would love to hear what I did wrong, especially regarding the read/write functions my track.erl module. And if I remember right, the read_trk/1 function did not work correctly under Windows, but I need to test that again to uphold this claim. Regards, Marc From per@REDACTED Sat Jul 26 07:56:22 2003 From: per@REDACTED (Per Bergqvist) Date: Sat, 26 Jul 2003 08:56:22 +0300 Subject: Need for new compiler directives to supress warnings In-Reply-To: Message-ID: <200307260656.h6Q6uNs07952@tessla.levonline.com> Hi, I think support of some directive to supress specific warnings should be added to the compiler/lint in future versions. The two most obvious things I would like to see is: 1) supression of warning definition of bif. this warning is, i guess, the result of the uncertainty of scope rules in the dark ages. i would like to be able to: -redefine_bif([size/1]). 2) supression of warning on use of obsolete functions. In some case use of obsolete is absolutely necessary like the use of hash for backward compatibility reasons. could be something like: -use_obsolete(erlang, [hash/2]). Comments ? /Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From per@REDACTED Sat Jul 26 08:06:45 2003 From: per@REDACTED (Per Bergqvist) Date: Sat, 26 Jul 2003 09:06:45 +0300 Subject: Use of timestamps in otp In-Reply-To: Message-ID: <200307260706.h6Q76ju08193@tessla.levonline.com> Hi, P9C contains a new function calendar:local_time_to_universal_time_dst/1. No problem with that but nn interesting observation is that there is no unambiguous tranformation of local_time -> universal_time. For universal_time -> local_time there is. I think that all parts of the system (i.e. sasl logging and snmp) should always generate time stamps in universal time and then convert to local time if requested by the user. Today the behaviour is the the opposite (timestamps are generated as local time) and it is not correct. Any comments ? /Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From joachim.durchholz@REDACTED Sat Jul 26 10:44:49 2003 From: joachim.durchholz@REDACTED (Joachim Durchholz) Date: Sat, 26 Jul 2003 10:44:49 +0200 Subject: Use of timestamps in otp In-Reply-To: <200307260706.h6Q76ju08193@tessla.levonline.com> References: <200307260706.h6Q76ju08193@tessla.levonline.com> Message-ID: <3F223F81.4070909@web.de> Per Bergqvist wrote: > No problem with that but nn interesting observation is that there is > no unambiguous tranformation of local_time -> universal_time. For > universal_time -> local_time there is. Do you mean stuff like "03:30 on the day when switching from summer time to winter time", when there is an extra hour between 03:00 and 04:00? This is nasty but manageable: the first hour is 03:00 to 04:00 EST, the second our 03:00 to 04:00 MET. (I hope that local time includes time zone information...) Are there other sources of ambiguity? > I think that all parts of the system (i.e. sasl logging and snmp) > should always generate time stamps in universal time and then convert > to local time if requested by the user. Today the behaviour is the > the opposite (timestamps are generated as local time) and it is not > correct. I'd agree with that. There are two reasons, both relevant only when data is gathered in different time zones: 1) Time zone information tends to be misconfigured. Under Unixoid systems, end users are able to set (and hence misconfigure) their TZ variable. UTC information is usually more reliable. 2) Comparing or subtracting timestamps gathered in different time zones is a bit complicated and easy to do wrong. UTC timestamps can be manipulated directly, with little room for dumb errors. Hope my 5 cent are of use, Jo From per@REDACTED Sat Jul 26 10:45:30 2003 From: per@REDACTED (Per Bergqvist) Date: Sat, 26 Jul 2003 11:45:30 +0300 Subject: Use of timestamps in otp In-Reply-To: <3F223F81.4070909@web.de> Message-ID: <200307260945.h6Q9jUK11247@tessla.levonline.com> > > Do you mean stuff like "03:30 on the day when switching from summer > time to winter time", when there is an extra hour between 03:00 and > 04:00? This is nasty but manageable: the first hour is 03:00 to 04:00 > EST, the second our 03:00 to 04:00 MET. (I hope that local time includes > time zone information...) > This is exactly the case and the local time stamp does not include time zone information. > > I'd agree with that. > There are two reasons, both relevant only when data is gathered in > different time zones: > 1) Time zone information tends to be misconfigured. Under Unixoid > systems, end users are able to set (and hence misconfigure) their TZ > variable. UTC information is usually more reliable. > 2) Comparing or subtracting timestamps gathered in different time zones > is a bit complicated and easy to do wrong. UTC timestamps can be > manipulated directly, with little room for dumb errors. > Totally agree. /P ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From richardc@REDACTED Sat Jul 26 13:20:10 2003 From: richardc@REDACTED (Richard Carlsson) Date: Sat, 26 Jul 2003 13:20:10 +0200 Subject: Need for new compiler directives to supress warnings References: <200307260656.h6Q6uNs07952@tessla.levonline.com> Message-ID: <000901c35367$e092a670$51ddd1d9@gnit> This could pretty easily be added. Although I would suggest a single declaration type for all such "pragmas": -pragma({redefine, {size,1}}). -pragma({use_obsolete, {erlang,hash,2}}). /Richard ----- Original Message ----- From: "Per Bergqvist" To: Sent: Saturday, July 26, 2003 7:56 AM Subject: Need for new compiler directives to supress warnings > Hi, > > I think support of some directive to supress specific warnings > should be added to the compiler/lint in future versions. > > The two most obvious things I would like to see is: > 1) supression of warning definition of bif. > this warning is, i guess, the result of the uncertainty of scope > rules in the dark ages. > i would like to be able to: > -redefine_bif([size/1]). > > 2) supression of warning on use of obsolete functions. > In some case use of obsolete is absolutely necessary > like the use of hash for backward compatibility reasons. > could be something like: > > -use_obsolete(erlang, [hash/2]). > > Comments ? > > /Per > > ========================================================= > Per Bergqvist > Synapse Systems AB > Phone: +46 709 686 685 > Email: per@REDACTED > > From per@REDACTED Sat Jul 26 12:25:22 2003 From: per@REDACTED (Per Bergqvist) Date: Sat, 26 Jul 2003 13:25:22 +0300 Subject: Need for new compiler directives to supress warnings In-Reply-To: <000901c35367$e092a670$51ddd1d9@gnit> Message-ID: <200307261125.h6QBPMX13515@tessla.levonline.com> Fine by me. /Per ------------------- > This could pretty easily be added. > Although I would suggest a single declaration type > for all such "pragmas": > > -pragma({redefine, {size,1}}). > > -pragma({use_obsolete, {erlang,hash,2}}). > > /Richard > > ----- Original Message ----- > From: "Per Bergqvist" > To: > Sent: Saturday, July 26, 2003 7:56 AM > Subject: Need for new compiler directives to supress warnings > > > > Hi, > > > > I think support of some directive to supress specific warnings > > should be added to the compiler/lint in future versions. > > > > The two most obvious things I would like to see is: > > 1) supression of warning definition of bif. > > this warning is, i guess, the result of the uncertainty of scope > > rules in the dark ages. > > i would like to be able to: > > -redefine_bif([size/1]). > > > > 2) supression of warning on use of obsolete functions. > > In some case use of obsolete is absolutely necessary > > like the use of hash for backward compatibility reasons. > > could be something like: > > > > -use_obsolete(erlang, [hash/2]). > > > > Comments ? > > > > /Per > > > > ========================================================= > > Per Bergqvist > > Synapse Systems AB > > Phone: +46 709 686 685 > > Email: per@REDACTED > > > > > ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From Erik.Stenman@REDACTED Sat Jul 26 13:13:26 2003 From: Erik.Stenman@REDACTED (Erik Stenman) Date: Sat, 26 Jul 2003 13:13:26 +0200 Subject: Need for new compiler directives to supress warnings In-Reply-To: <200307260656.h6Q6uNs07952@tessla.levonline.com> Message-ID: <005001c35366$efd13260$9224fea9@lamppc36> Yes! I have been asking for these kind of flags for a long time. I am constantly redefining size... As far as I remember there is a problem in that the linter is executed before the compiler flags in the file are parsed. So with the current architecture, even if the linter could handle these flags they would have to be passed as arguments to the compiler instead of being specified in the source file, which would be somewhat annoying. > Hi, > > I think support of some directive to supress specific warnings > should be added to the compiler/lint in future versions. > > The two most obvious things I would like to see is: > 1) supression of warning definition of bif. > this warning is, i guess, the result of the uncertainty of > scope rules in the dark ages. > i would like to be able to: > -redefine_bif([size/1]). > > 2) supression of warning on use of obsolete functions. > In some case use of obsolete is absolutely necessary > like the use of hash for backward compatibility reasons. > could be something like: > > -use_obsolete(erlang, [hash/2]). > > Comments ? > > /Per > > ========================================================= > Per Bergqvist > Synapse Systems AB > Phone: +46 709 686 685 > Email: per@REDACTED > From per@REDACTED Sun Jul 27 01:15:19 2003 From: per@REDACTED (Per Bergqvist) Date: Sun, 27 Jul 2003 02:15:19 +0300 Subject: Need for new compiler directives to supress warnings In-Reply-To: <200307261125.h6QBPMX13515@tessla.levonline.com> Message-ID: <200307270015.h6R0FJK30301@tessla.levonline.com> Checked a bit more into this. The easiest way is probably to use -compile({redefine_bif, {size, 1}}). -compile({redefine_bif, [{spawn, 2}, {spawn, 3}]}). -compile({use_obsolete, {erlang, hash, 2}}). This will also allow the use of command line options like erlc -W +'{redefine_bif, {spawn,2}' foobar.erl By using a compile declaration only erl_lint.erl needs to be changed and the options used will be stored in the resulting beam file. Attached is a small patch that does this relative 2003-07-25 snapshot. Comments ? /Per ------------------- > Fine by me. > > /Per > ------------------- > > This could pretty easily be added. > > Although I would suggest a single declaration type > > for all such "pragmas": > > > > -pragma({redefine, {size,1}}). > > > > -pragma({use_obsolete, {erlang,hash,2}}). > > > > /Richard > > > > ----- Original Message ----- > > From: "Per Bergqvist" > > To: > > Sent: Saturday, July 26, 2003 7:56 AM > > Subject: Need for new compiler directives to supress warnings > > > > > > > Hi, > > > > > > I think support of some directive to supress specific warnings > > > should be added to the compiler/lint in future versions. > > > > > > The two most obvious things I would like to see is: > > > 1) supression of warning definition of bif. > > > this warning is, i guess, the result of the uncertainty of > scope > > > rules in the dark ages. > > > i would like to be able to: > > > -redefine_bif([size/1]). > > > > > > 2) supression of warning on use of obsolete functions. > > > In some case use of obsolete is absolutely necessary > > > like the use of hash for backward compatibility reasons. > > > could be something like: > > > > > > -use_obsolete(erlang, [hash/2]). > > > > > > Comments ? > > > > > > /Per > > > > > > ========================================================= > > > Per Bergqvist > > > Synapse Systems AB > > > Phone: +46 709 686 685 > > > Email: per@REDACTED > > > > > > > > > ========================================================= > Per Bergqvist > Synapse Systems AB > Phone: +46 709 686 685 > Email: per@REDACTED > ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED -------------- next part -------------- A non-text attachment was scrubbed... Name: compiler_supress.patch Type: application/octet-stream Size: 1940 bytes Desc: not available URL: From per@REDACTED Sun Jul 27 09:38:46 2003 From: per@REDACTED (Per Bergqvist) Date: Sun, 27 Jul 2003 10:38:46 +0300 Subject: behaviours Message-ID: <200307270838.h6R8ck012689@tessla.levonline.com> Hi, some questions regarding behaviours 1) a few modules requests multiple behaviours. what is the purpose of this ? 2) in megaco and mnesia user defined behaviours are requested but the target modules does not define the behaviour_info. why ? /Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From richardc@REDACTED Sun Jul 27 13:59:57 2003 From: richardc@REDACTED (Richard Carlsson) Date: Sun, 27 Jul 2003 13:59:57 +0200 Subject: Need for new compiler directives to supress warnings References: <200307270015.h6R0FJK30301@tessla.levonline.com> Message-ID: <004101c35436$9ca0fff0$51ddd1d9@gnit> Of course you're right: -compile(...) is the way to go. /Richard ----- Original Message ----- From: "Per Bergqvist" To: "Per Bergqvist" Cc: "Richard Carlsson" ; Sent: Sunday, July 27, 2003 1:15 AM Subject: Re: Need for new compiler directives to supress warnings > Checked a bit more into this. > > The easiest way is probably to use > > -compile({redefine_bif, {size, 1}}). > -compile({redefine_bif, [{spawn, 2}, {spawn, 3}]}). > -compile({use_obsolete, {erlang, hash, 2}}). > > This will also allow the use of command line options like > > erlc -W +'{redefine_bif, {spawn,2}' foobar.erl > > By using a compile declaration only erl_lint.erl needs to be > changed and the options used will be stored in the resulting > beam file. > > Attached is a small patch that does this relative 2003-07-25 snapshot. > > Comments ? > > /Per > > ------------------- > > Fine by me. > > > > /Per > > ------------------- > > > This could pretty easily be added. > > > Although I would suggest a single declaration type > > > for all such "pragmas": > > > > > > -pragma({redefine, {size,1}}). > > > > > > -pragma({use_obsolete, {erlang,hash,2}}). > > > > > > /Richard > > > > > > ----- Original Message ----- > > > From: "Per Bergqvist" > > > To: > > > Sent: Saturday, July 26, 2003 7:56 AM > > > Subject: Need for new compiler directives to supress warnings > > > > > > > > > > Hi, > > > > > > > > I think support of some directive to supress specific warnings > > > > should be added to the compiler/lint in future versions. > > > > > > > > The two most obvious things I would like to see is: > > > > 1) supression of warning definition of bif. > > > > this warning is, i guess, the result of the uncertainty of > > scope > > > > rules in the dark ages. > > > > i would like to be able to: > > > > -redefine_bif([size/1]). > > > > > > > > 2) supression of warning on use of obsolete functions. > > > > In some case use of obsolete is absolutely necessary > > > > like the use of hash for backward compatibility reasons. > > > > could be something like: > > > > > > > > -use_obsolete(erlang, [hash/2]). > > > > > > > > Comments ? > > > > > > > > /Per > > > > > > > > ========================================================= > > > > Per Bergqvist > > > > Synapse Systems AB > > > > Phone: +46 709 686 685 > > > > Email: per@REDACTED > > > > > > > > > > > > > ========================================================= > > Per Bergqvist > > Synapse Systems AB > > Phone: +46 709 686 685 > > Email: per@REDACTED > > > ========================================================= > Per Bergqvist > Synapse Systems AB > Phone: +46 709 686 685 > Email: per@REDACTED From ulf.wiger@REDACTED Sun Jul 27 22:03:09 2003 From: ulf.wiger@REDACTED (Wiger Ulf) Date: Sun, 27 Jul 2003 22:03:09 +0200 Subject: behaviours References: <200307270838.h6R8ck012689@tessla.levonline.com> Message-ID: <000b01c3547a$1b9fb2e0$fd7a40d5@telia.com> "Per Bergqvist", , wrote: > some questions regarding behaviours > > 1) a few modules requests multiple behaviours. > what is the purpose of this ? Laziness. ;-) You can, for example, combine gen_server and gen_event, or gen_server and supervisor in one module, but this tricks the linter, confuses the reader, and is in general a bad idea IMO. > 2) in megaco and mnesia user defined behaviours are requested > but the target modules does not define the behaviour_info. > why ? Back in the old days, you could not define your own behaviour without hacking some OTP code. I vaguely recall mnesia providing a "quasi behaviour", which wasn't really a known behaviour, but well could have been. My guess is that the behaviour_info/1 function has not been added yet, since the option to do so is a fairly recent addition. /Uffe From per@REDACTED Mon Jul 28 07:54:04 2003 From: per@REDACTED (Per Bergqvist) Date: Mon, 28 Jul 2003 08:54:04 +0300 Subject: behaviours In-Reply-To: <000b01c3547a$1b9fb2e0$fd7a40d5@telia.com> Message-ID: <200307280654.h6S6s4T06026@tessla.levonline.com> ------------------- > "Per Bergqvist", , wrote: > > > some questions regarding behaviours > > > > 1) a few modules requests multiple behaviours. > > what is the purpose of this ? > > Laziness. ;-) > > You can, for example, combine gen_server and gen_event, > or gen_server and supervisor in one module, but this tricks > the linter, confuses the reader, and is in general a bad idea IMO. Agree that it is a bad idea in general. However, it does not trick the linter. Linter checks for all callback properly. The only thing is that it emits the warning for several behaviours. Reworked my lint patch a bit to support yet another compile option. When this version the several behaviour may be supressed by definining: -compile(several_behaviours). -compile({several_behaviours, [application, supervisor]}). or erlc -W +several_behaviours foo.erl erlc -W +'{several_behaviours, [application, supervisor]}' foo.erl > > > 2) in megaco and mnesia user defined behaviours are requested > > but the target modules does not define the behaviour_info. > > why ? > > Back in the old days, you could not define your own behaviour > without hacking some OTP code. I vaguely recall mnesia providing > a "quasi behaviour", which wasn't really a known behaviour, but > well could have been. > > My guess is that the behaviour_info/1 function has not been added > yet, since the option to do so is a fairly recent addition. > Still don't see why one would like to use a -behaviour if there is no underlying support for it. It will basically be a no-op except for the warning. Am I missing something ? > /Uffe > /Per -------------- next part -------------- A non-text attachment was scrubbed... Name: erl_lint.patch_2 Type: application/octet-stream Size: 2556 bytes Desc: not available URL: From bjorn@REDACTED Mon Jul 28 10:49:00 2003 From: bjorn@REDACTED (=?ISO-8859-1?Q?Bj=F6rn_Bylander?=) Date: Mon, 28 Jul 2003 10:49:00 +0200 Subject: Catch not found - abnormal program termination In-Reply-To: <20030725184229.59557.qmail@web41901.mail.yahoo.com> References: <20030725184229.59557.qmail@web41901.mail.yahoo.com> Message-ID: <3F24E37C.6040206@loxysoft.se> Yes, but the "Abort" part is just the shell indicating that the program received a SIGABRT and then terminated. The same goes for the "abnormal program termination" I get under Windows. I get a erl_crash.dump under Linux, anyone interested? Bj?rn Thomas Lindgren wrote: >--- Bj?rn_Bylander wrote: > > >>Hi, >> >>Given the module below and the function call >>"test_srv:start_link(foo)." >>from the Erlang shell, why does Erlang crash with >>"Catch not found"? >>It crashes for me under v5.2.3.3, Linux on an x86 >>and under v5.2, >>Windows 2000. >>Can anyone else reproduce it? >> >> > >Running your code under RedHat 8, v5.2.3.3, I get >nearly the same result: >"Catch not foundAbort" > >Best, >Thomas > > From thomasl_erlang@REDACTED Mon Jul 28 11:28:59 2003 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Mon, 28 Jul 2003 02:28:59 -0700 (PDT) Subject: behaviours In-Reply-To: <200307280654.h6S6s4T06026@tessla.levonline.com> Message-ID: <20030728092859.4760.qmail@web41904.mail.yahoo.com> --- Per Bergqvist wrote: > Still don't see why one would like to use a > -behaviour if there > is no underlying support for it. It will basically > be a no-op except > for the warning. Am I missing something ? As far as I know, all behaviours work that way: they just verify that the module exports the right functions. I think, however, that user-defined behaviours are an excellent idea: behaviours are useful because they formalize an expected interface and provide the basis for further documentation. A bit like Javas interfaces, say. (With user-defined behaviours, one also has the gotcha that the behaviour files should be compiled before any of those who use the behaviour.) If a module has several behaviours, which I *do* think should be possible, a linter should probably check that their required functions do not overlap. In that case, something is likely to be wrong. Okay, that's the main reply. I have been thinking a bit about behaviours, so here are some more things to ponder: * Should we keep around the fact that a module has a behaviour, so that we can check this at runtime? (e.g., gen_server can check that the callback module has -behaviour(gen_server)). module_info/1 can keep track of this easily. (Strictly speaking, this is *not* the same thing as the module exporting the functions required by gen_server :-) * Should behaviours also *require* some functions (ie, yield an error rather than a warning if f/n is not exported)? * Should we have versioning of behaviours, beyond the versioning of SASL? (Several versions of foo_b in the system?) * Finally, I would like a mechanism for composing behaviours: roughly speaking, that B = compose(B1,B2,B3) yields at runtime a "module" B that behaves like modules B1 and B2 and B3. (Usable for any number of Bi, preferrably) There is a straightforward way of doing this -- dynamically generate and compile a new module -- but I think that's a bit too heavyweight and might not quite do the right thing. Best, Thomas __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From thomasl_erlang@REDACTED Mon Jul 28 12:54:23 2003 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Mon, 28 Jul 2003 03:54:23 -0700 (PDT) Subject: behaviours In-Reply-To: <20030728092859.4760.qmail@web41904.mail.yahoo.com> Message-ID: <20030728105423.7145.qmail@web41902.mail.yahoo.com> Bad form to reply to self, but: generating, compiling and loading a composite module currently requires roughly 60ms on my Athlon 1300+. Not something to be used in inner loops, thus. (The algorithm to generate the module could be sped up somewhat, but I suspect this is a small part of the time.) A second drawback with this method is that such anonymous modules of course won't be garbage collected. Best, Thomas __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From bjorn@REDACTED Mon Jul 28 13:27:49 2003 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 28 Jul 2003 13:27:49 +0200 Subject: Catch not found - abnormal program termination In-Reply-To: <3F24E37C.6040206@loxysoft.se> References: <20030725184229.59557.qmail@web41901.mail.yahoo.com> <3F24E37C.6040206@loxysoft.se> Message-ID: Thanks for bug report. I am investigating the problem right now and I'll try to include a correction in the upcoming R9C. /Bjorn Bj?rn Bylander writes: > Yes, but the "Abort" part is just the shell indicating that the > program received a SIGABRT and then terminated. The same goes for the > "abnormal program termination" I get under Windows. > I get a erl_crash.dump under Linux, anyone interested? > > Bj?rn > > Thomas Lindgren wrote: > > >--- Bj?rn_Bylander wrote: > > > >>Hi, > >> > >>Given the module below and the function call > >> "test_srv:start_link(foo)." from the Erlang shell, why does Erlang > >> crash with > >>"Catch not found"? > >>It crashes for me under v5.2.3.3, Linux on an x86 > >> and under v5.2, Windows 2000. > >>Can anyone else reproduce it? > >> > > > >Running your code under RedHat 8, v5.2.3.3, I get > >nearly the same result: > >"Catch not foundAbort" > > > >Best, > >Thomas > > > -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From Chandrashekhar.Mullaparthi@REDACTED Mon Jul 28 13:34:35 2003 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Mon, 28 Jul 2003 12:34:35 +0100 Subject: behaviours Message-ID: > -----Original Message----- > From: Thomas Lindgren [mailto:thomasl_erlang@REDACTED] > > --- Per Bergqvist wrote: > > Still don't see why one would like to use a > > -behaviour if there > > is no underlying support for it. It will basically > > be a no-op except > > for the warning. Am I missing something ? > > * Should we keep around the fact that a module has a > behaviour, so that we can check this at runtime? > (e.g., gen_server can check that the callback module > has -behaviour(gen_server)). module_info/1 can keep > track of this easily. > > (Strictly speaking, this is *not* the same thing as > the module exporting the functions required by > gen_server :-) > > * Should behaviours also *require* some functions (ie, > yield an error rather than a warning if f/n is not > exported)? I dont think requiring some functions is a good idea. gen_server for instance provides three different ways for a server to interact with the outside world. If I choose to use only gen_server:call in my server, I dont want to provide dummy functions and clutter the code. The same could be said of user defined behaviours. Taking the example of Java interfaces, the Java compiler enforces implementation of all functions in an interface which leads to lot of bloatware when writing new classes. regards Chandru NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From vlad_dumitrescu@REDACTED Mon Jul 28 13:33:48 2003 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Mon, 28 Jul 2003 13:33:48 +0200 Subject: Distributing computations Message-ID: Hi and welcome back from vacations (for those who had any, like me) One of my work duties involves writing and running large number-crunching computations (taking for example 2-4 weeks when run on a single top-of-the-line machine). Since as everywhere there is a lot of PC power that is unused, I thought that having a platform for distributing and coordinating these computations would help a lot. And it might be a good way to introduce Erlang to the company. I convinced my boss to let me give it a try, and now I am investigating the options. The architecture that looks best right now is in the style of for example "SETI at home", with a server sending/receiving data and updating the local clients. Since the actual job is not suitable for Erlang (I tried) there will be small C programs thet will do the actual work. What I wonder is whether anyone could give me some pointers to any related work, because I need to have something to compare with. Hopefully not all such platforms are closed. Thanks in advance, Best regards, Vlad From vances@REDACTED Mon Jul 28 15:10:39 2003 From: vances@REDACTED (Vance Shipley) Date: Mon, 28 Jul 2003 09:10:39 -0400 Subject: Can't open character-special file Message-ID: <20030728131039.GA56404@frogman.motivity.ca> 1> file:open("adc@REDACTED,9e:00temperature", [read, raw, binary]). {error,eisdir} This is not a directory but a character-special file: cr--r--r-- 1 root sys 163,256 Jul 27 00:54 adc@REDACTED,9e:00temperature 2> file:read_file_info("adc@REDACTED,9e:00temperature,translated"). {ok,{file_info,2147483647, device, read, {{2003,7,27},{0,54,37}}, {{2003,7,27},{0,54,37}}, {{2003,7,27},{0,54,37}}, 8484, 1, 8388608, 42729728, 12699, 0, 3}} Is there any way around this? Am I asking for something unreasonable? I just want to be able to open these files and read a single byte: 3> file:read(IoDevice, 1). In case you're wondering this is how you access the current temperauture readings from the thermistor on board a SUN OEM processor board (e.g. CP1500). -Vance Vance Shipley Motivity Telecom Inc. +1 519 240 3684 vances@REDACTED From fredrik.linder@REDACTED Mon Jul 28 15:22:31 2003 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Mon, 28 Jul 2003 15:22:31 +0200 Subject: behaviours In-Reply-To: Message-ID: > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Chandrashekhar > Mullaparthi > > > -----Original Message----- > > From: Thomas Lindgren [mailto:thomasl_erlang@REDACTED] > > > > --- Per Bergqvist wrote: > > > Still don't see why one would like to use a > > > -behaviour if there > > > is no underlying support for it. It will basically > > > be a no-op except > > > for the warning. Am I missing something ? > > > > * Should we keep around the fact that a module has a > > behaviour, so that we can check this at runtime? > > (e.g., gen_server can check that the callback module > > has -behaviour(gen_server)). module_info/1 can keep > > track of this easily. > > > > (Strictly speaking, this is *not* the same thing as > > the module exporting the functions required by > > gen_server :-) Imho I do not think this is the way to go, since if the actual behaviour-definition changes when running the system (horrible but possible), then each module flagged to fulfill the requirements for that behaviour needs to re-evaluate it's compliance to that behaviour. I'm not saying the check shouldn't be there, 'cause I'd want it. Though, the check should rather be dynamic. Something like: check_behaviour(Behaviour, Module, all) -> case erlang:function_exported(Behaviour, behaviour_info, 1) of true -> Callbacks = Behaviour:behaviour_info(callbacks), F = fun({F, A}) -> erlang:function_exported(Module, F, A) end, lists:all(F, Callbacks); false -> exit({badarg, Behaviour}) end; check_behaviour(Behaviour, Module, Functions) -> case erlang:function_exported(Behaviour, behaviour_info, 1) of true -> Callbacks = Behaviour:behaviour_info(callbacks), F = fun({F, A} = C) -> erlang:function_exported(Module, F, A) orelse not lists:member(C, Functions) end, lists:all(F, Callbacks); false -> exit({badarg, Behaviour}) end. Btw, this is a perfect use of the erlang:function_exported/3 function -- perhaps time to change the documentation? > > * Should behaviours also *require* some functions (ie, > > yield an error rather than a warning if f/n is not > > exported)? > > I dont think requiring some functions is a good idea. gen_server for > instance provides three different ways for a server to interact with the > outside world. If I choose to use only gen_server:call in my > server, I dont > want to provide dummy functions and clutter the code. The same > could be said > of user defined behaviours. Still the init function is required for gen_server... So there still is some use for such functionality. Guess it'd suffice with a warning though. > Taking the example of Java interfaces, the Java compiler enforces > implementation of all functions in an interface which leads to lot of > bloatware when writing new classes. From luke@REDACTED Mon Jul 28 15:40:35 2003 From: luke@REDACTED (Luke Gorrie) Date: 28 Jul 2003 15:40:35 +0200 Subject: Distributing computations In-Reply-To: References: Message-ID: "Vlad Dumitrescu" writes: > One of my work duties involves writing and running large > number-crunching computations (taking for example 2-4 weeks when run > on a single top-of-the-line machine). Since as everywhere there is a > lot of PC power that is unused, I thought that having a platform for > distributing and coordinating these computations would help a > lot. And it might be a good way to introduce Erlang to the company. > > I convinced my boss to let me give it a try, and now I am > investigating the options. The architecture that looks best right > now is in the style of for example "SETI at home", with a server > sending/receiving data and updating the local clients. Since the > actual job is not suitable for Erlang (I tried) there will be small > C programs thet will do the actual work. I've never done any of this stuff, but have been doing some reading and looking for an excuse to :-). You're not getting any solid info out of me, but maybe some inspiring/entertaining/distracting links :-) It seems the main trick is to design an algorithm that can run in parallel. _Data Parallel Algorithms_ is a really cool introduction to one flavour of this. It's geared towards very fine-grained parallelism (when they analyse algorithms they usually assume infinite processors!) Then it seems a popular package today is Parallel Virtual Machine (PVM), http://www.csm.ornl.gov/pvm/pvm_home.html. I think you can turn up a lot of applications of it via Google. (I have read some stuff about raytracing algorithms with benchmarks of PVM vs. Connection Machine and stuff.) (BTW, I just read the last chapter of _The Connection Machine_, titled "Connection Machine Physics, or Why Computer Science is No Good." Wonderful!!) Cheers, Luke [1]: Data Parallel Algorithms, by Danny Hillis and Guy Steele. http://cva.stanford.edu/cs99s/papers/hillis-steele-data-parallel-algorithms.pdf From svg@REDACTED Mon Jul 28 15:36:11 2003 From: svg@REDACTED (Vladimir Sekissov) Date: Mon, 28 Jul 2003 19:36:11 +0600 (YEKST) Subject: Can't open character-special file In-Reply-To: <20030728131039.GA56404@frogman.motivity.ca> References: <20030728131039.GA56404@frogman.motivity.ca> Message-ID: <20030728.193611.45511897.svg@surnet.ru> Good day, You can use os:cmd as workaround: os:cmd("dd if=adc@REDACTED,9e:00temperature bs=1 count=1 2>/dev/null") Best Regards, Vladimir Sekissov vances> 1> file:open("adc@REDACTED,9e:00temperature", [read, raw, binary]). vances> {error,eisdir} From vlad_dumitrescu@REDACTED Mon Jul 28 15:53:42 2003 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Mon, 28 Jul 2003 15:53:42 +0200 Subject: Distributing computations References: Message-ID: Hi, From: "Luke Gorrie" > I've never done any of this stuff, but have been doing some reading > and looking for an excuse to :-). You're not getting any solid info > out of me, but maybe some inspiring/entertaining/distracting links :-) I don't expect a solution, but just as you say - inspiration! > It seems the main trick is to design an algorithm that can run in > parallel. Yes, that's one thing that has to be tailored after the specific problem at hand. > Then it seems a popular package today is Parallel Virtual Machine > (PVM), http://www.csm.ornl.gov/pvm/pvm_home.html. I was thinking about using Erlang as back-end :-) I found some references at http://www.aspenleaf.com/distributed/distrib-devel.html, and I think ideas from Q2ADPZ (at http://qadpz.idi.ntnu.no) could be reused with relative ease. The fact is, ERTS does already a lot of the things that such a beast should do, and better - probably except only the security aspects. And, hey!, it's also a good oportunity to use UBF, both -A and -B! :-) Thanks for the input. Regards, Vlad From bjorn@REDACTED Mon Jul 28 16:15:10 2003 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 28 Jul 2003 16:15:10 +0200 Subject: Catch not found - abnormal program termination In-Reply-To: <3F213F27.9000909@loxysoft.se> References: <3F213F27.9000909@loxysoft.se> Message-ID: I've found and fixed the compiler bug. The correction will be included in R9C. /Bjorn Bj?rn Bylander writes: > Hi, > > Given the module below and the function call > "test_srv:start_link(foo)." from the Erlang shell, why does Erlang > crash with "Catch not found"? > It crashes for me under v5.2.3.3, Linux on an x86 and under v5.2, > Windows 2000. > Can anyone else reproduce it? > > Bj?rn Bylander > > -module(test_srv). > -behaviour(gen_server). > -export([start_link/1]). > -export([init/1, handle_call/3, handle_cast/2, handle_info/2, > terminate/2, code_change/3]). > > start_link(Param) -> > gen_server:start_link(?MODULE, Param, []). > > init(Param) -> > process_flag(trap_exit, true), > (catch begin > foo(Param), > (catch exit(bar)) > end > ), > ignore. > > foo(_) -> ok. > > handle_call(Call, From, State) -> {noreply, State}. > handle_cast(Msg, State) -> {noreply, State}. > handle_info(Msg, State) -> {noreply, State}. > terminate(Reason, State) -> ok. > code_change(OldVsn, State, Extra) -> {ok, State}. > > -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From thomasl_erlang@REDACTED Mon Jul 28 17:13:13 2003 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Mon, 28 Jul 2003 08:13:13 -0700 (PDT) Subject: behaviours In-Reply-To: Message-ID: <20030728151313.50767.qmail@web41905.mail.yahoo.com> --- Chandrashekhar Mullaparthi wrote: > I dont think requiring some functions is a good > idea. gen_server for > instance provides three different ways for a server > to interact with the > outside world. If I choose to use only > gen_server:call in my server, I dont > want to provide dummy functions and clutter the > code. The same could be said > of user defined behaviours. I think I was unclear. The idea was not to _always_ require functions, but to enable the behaviour-writer to mark _some_ functions as required, as dictated by the behaviour code. "If you don't provide these functions, the behaviour won't ever run." For gen_server, the init function might be required, while call/cast/... could be optional, etc. Best, Thomas __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From thomasl_erlang@REDACTED Mon Jul 28 17:32:02 2003 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Mon, 28 Jul 2003 08:32:02 -0700 (PDT) Subject: behaviours In-Reply-To: Message-ID: <20030728153202.62169.qmail@web41905.mail.yahoo.com> --- Fredrik Linder wrote: > Imho I do not think this is the way to go, since if > the actual > behaviour-definition changes when running the system > (horrible but > possible), then each module flagged to fulfill the > requirements for that > behaviour needs to re-evaluate it's compliance to > that behaviour. That might be an argument for versioning of behaviours, I think. (In principle, the same is true today, except there is no notification that it happened.) Though perhaps no notification is needed either? (Or one could write an extension of code.erl that does such checking.) Anyway, Getting It Right might take some thought. What I had in mind was basically has_behaviour(M, B) -> lists:member(B, M:module_info(behaviours)). and the compiler tracking what behaviours were declared in M and putting them in the module_info. Then the programmers can insert checks that M has the right behaviour when they write a behaviour, for example, checking before a server is started. Best, Thomas __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From Marc.Vanwoerkom@REDACTED Mon Jul 28 18:28:48 2003 From: Marc.Vanwoerkom@REDACTED (Marc Ernst Eddy van Woerkom) Date: Mon, 28 Jul 2003 18:28:48 +0200 (MEST) Subject: Tutorial In-Reply-To: (mike@erix.ericsson.se) Message-ID: <200307281628.h6SGSm116901@bonsai.fernuni-hagen.de> > hopefully help to get people started. A specification is being > written separately (by Gunnila Arendt) and when this is ready, > this tutorial I hope to addend the tutorial to cross reference > the spec. Is that spec available? > The tutorial is available at: > > http://www.erlang.org/doc/misc/tut.txt > > and is a plain text file. All the example programs can be copy / pasted > from this files and be compiled and run. Thanks, I am half trough yet. Regards, Marc From erlang@REDACTED Mon Jul 28 19:35:30 2003 From: erlang@REDACTED (Peter-Henry Mander) Date: Mon, 28 Jul 2003 18:35:30 +0100 Subject: P9C: Compilation hangs when last line is a comment with no newline Message-ID: <3F255EE2.6030201@manderp.freeserve.co.uk> Eshell V2003.07.28 c(testing). hangs indefinitely, testing.erl contents are: -module(testing). -export([]). % last line with no newline From kent@REDACTED Mon Jul 28 22:01:28 2003 From: kent@REDACTED (Kent Boortz) Date: 28 Jul 2003 22:01:28 +0200 Subject: Tutorial In-Reply-To: <200307281628.h6SGSm116901@bonsai.fernuni-hagen.de> References: <200307281628.h6SGSm116901@bonsai.fernuni-hagen.de> Message-ID: Marc Ernst Eddy van Woerkom writes: > > hopefully help to get people started. A specification is being > > written separately (by Gunnila Arendt) and when this is ready, > > this tutorial I hope to addend the tutorial to cross reference > > the spec. > > Is that spec available? It is part of the complete documentation for R9C http://www.erlang.org/download/snapshots/otp_html_R9C_2003-XX-XX_XX.tar.gz kent From ulf.wiger@REDACTED Mon Jul 28 22:48:08 2003 From: ulf.wiger@REDACTED (Wiger Ulf) Date: Mon, 28 Jul 2003 22:48:08 +0200 Subject: behaviours References: <20030728092859.4760.qmail@web41904.mail.yahoo.com> Message-ID: <004101c35549$8d7a9360$fd7a40d5@telia.com> From: "Thomas Lindgren" > If a module has several behaviours, which I *do* think > should be possible, a linter should probably check > that their required functions do not overlap. In that > case, something is likely to be wrong. This is the main reason why I'm against multiple behaviours. The functions _are_ likely to overlap, or differ only in arity. Consider for example init(), handle_call(), terminate(), which can be found in gen_server, gen_fsm, gen_event. The behaviour framework was obviously based on the assumption one module <-> one behaviour, and, if anything, _encourages_ cloning callback names from other behaviours. /Uffe From fgonthier@REDACTED Mon Jul 28 23:38:32 2003 From: fgonthier@REDACTED (=?iso-8859-1?Q?Fran=E7ois-Denis_Gonthier?=) Date: Mon, 28 Jul 2003 17:38:32 -0400 Subject: Tutorial In-Reply-To: Message-ID: Good job. This tutorial would have been so welcome when I started playing with Erlang few months ago. :) sadly, I'm rarely take time to carefully read things I've printed of the net so I'm not really the kind of guy that will make useful suggestions or error reports. I have nonetheless noticed something that might be a typo in the code. in module tut18, shouldn't the start function read: start(Ping_Node) -> register(pong, spawn(tut18, pong, [])), spawn(Ping_Node, tut17, ping, [3, node()]). -----Message d'origine----- De : owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED]De la part de Mike Williams Envoy? : 23 juillet 2003 10:54 ? : erlang-questions@REDACTED Objet : Tutorial I have written a tutorial covering most of the basics of Erlang. OTP is not covered. This is not a specification of Erlang, rather a text which will hopefully help to get people started. A specification is being written separately (by Gunnila Arendt) and when this is ready, this tutorial I hope to addend the tutorial to cross reference the spec. The tutorial is available at: http://www.erlang.org/doc/misc/tut.txt and is a plain text file. All the example programs can be copy / pasted from this files and be compiled and run. What I would like now are comments, errata and sugestions for improvements. /mike From byron.hale@REDACTED Tue Jul 29 00:36:59 2003 From: byron.hale@REDACTED (Byron Hale) Date: Mon, 28 Jul 2003 15:36:59 -0700 Subject: What about Erlang semantics? Message-ID: <5.2.0.9.2.20030728153254.025560e8@einfo.com> If I understand Erlang semantics, it must have compile time binding to be functional. However, the mention of Object Orientation concerns me, because OO programming usually has runtime binding. Also, Erlang appears to have eager evaluation, as it has "soft" runtime requirements. Will someone clarify these issues for me? Thanks, Byron Hale byron.hale@REDACTED From sean.hinde@REDACTED Tue Jul 29 00:55:29 2003 From: sean.hinde@REDACTED (Sean Hinde) Date: Mon, 28 Jul 2003 23:55:29 +0100 Subject: gen_fsm timers made it in P9C! Message-ID: <9609C751-C14E-11D7-8025-000A95927CCE@mac.com> Hurrah! I can finally throw away my patched version of gen_fsm which supports state aware timers (http://www.erlang.org/ml-archive/erlang-questions/200107/ msg00012.html). Thank you OTP team! Sean From roger@REDACTED Tue Jul 29 07:32:23 2003 From: roger@REDACTED (roger) Date: Mon, 28 Jul 2003 22:32:23 -0700 Subject: OT: First Regular Erlang Beer Break Message-ID: <07FAE771-C186-11D7-9250-0003938748D4@young-river.com> Just came back from the very first regular erlang beer break. It was fun to meet some of the folks on this list in person. The beginning was interesting: spot the engineer in a crowd of about 50 people. The bad news: it was pretty easy :-) The beer was good, the temparature chilly. Look forward to the next one. Jim, Byron, Lennart, Sebastian, Bart, Maurice 't was a pleasure to meet you. -Roger From fredrik.linder@REDACTED Tue Jul 29 09:10:05 2003 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Tue, 29 Jul 2003 09:10:05 +0200 Subject: behaviours In-Reply-To: <20030728153202.62169.qmail@web41905.mail.yahoo.com> Message-ID: > > Imho I do not think this is the way to go, since if > > the actual > > behaviour-definition changes when running the system > > (horrible but > > possible), then each module flagged to fulfill the > > requirements for that > > behaviour needs to re-evaluate it's compliance to > > that behaviour. > > That might be an argument for versioning of > behaviours, I think. (In principle, the same is true > today, except there is no notification that it > happened.) Good point. Versioning is definitely desired, perhaps something like: behaviour_info(callbacks) -> [{Function, Arity}]; behaviour_info(version) -> Version; behaviour_info(_) -> undefined. > Though perhaps no notification is needed either? (Or > one could write an extension of code.erl that does > such checking.) > > Anyway, Getting It Right might take some thought. What > I had in mind was basically > > has_behaviour(M, B) -> > lists:member(B, M:module_info(behaviours)). > > and the compiler tracking what behaviours were > declared in M and putting them in the module_info. > Then the programmers can insert checks that M has the > right behaviour when they write a behaviour, for > example, checking before a server is started. Adding version could look like: has_behaviour(M, B, V) -> lists:member({B, V}, M:module_info(behaviours)). I just realized there are two points where the behaviour information is beneficial: o at compile time - to notify the code writer/compiler about non-implemented functions defined in the behaviour(s). o at load time - to notify the code loader (person?) about behaviour mismatch. The first requires the presence of the behaviour with the correct version, to verify the function list. The second requires only a behaviour implementation statement (with version). Best, Fredrik From fredrik.linder@REDACTED Tue Jul 29 09:37:02 2003 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Tue, 29 Jul 2003 09:37:02 +0200 Subject: behaviours In-Reply-To: <004101c35549$8d7a9360$fd7a40d5@telia.com> Message-ID: > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Wiger Ulf > > From: "Thomas Lindgren" > > > If a module has several behaviours, which I *do* think > > should be possible, a linter should probably check > > that their required functions do not overlap. In that > > case, something is likely to be wrong. > > This is the main reason why I'm against multiple behaviours. > The functions _are_ likely to overlap, or differ only in arity. > Consider for example init(), handle_call(), terminate(), > which can be found in gen_server, gen_fsm, gen_event. > The behaviour framework was obviously based on the > assumption one module <-> one behaviour, and, if anything, > _encourages_ cloning callback names from other behaviours. One of the uses I have for behaviours is to maintain knowledge about why a certain function is exported from a module. As an example I'd have: o One behaviour to list operational functions (start/stop) o One behaviour to list administrative functions (set cache size/...) o One behaviour for each other functionality (add user/remove user or permit_user/is_user_permitted or determine user violations (whatever)) In this way I'd say that multiple behaviours are very desireable. This could of course be put into separate modules, but doing so distributes the knowledge that I'd like to keep very close together, and is hence not desireable. It'd only make the code more difficult to read and understand. Behaviours like the once I've listed here are non-overlapping in role domain (how is this process started?, how do I change the cache settings?, ...), while behaviours such as gen_server and gen_fsm have overlapping domains - they state different behaviours for a common role (what is the general behaviour of this process?). In the latter case I agree with Wiger - allow only one behaviour per module, but in the former case I am not - allow several behaviours per module. Best /Fredrik From vlad_dumitrescu@REDACTED Tue Jul 29 10:01:58 2003 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Tue, 29 Jul 2003 10:01:58 +0200 Subject: behaviours References: Message-ID: Hi, From: "Fredrik Linder" > As an example I'd have: > > o One behaviour to list operational functions (start/stop) > o One behaviour to list administrative functions (set cache size/...) > o One behaviour for each other functionality (add user/remove user or > permit_user/is_user_permitted or determine user violations (whatever)) > > In this way I'd say that multiple behaviours are very desireable. This use of behaviours is more or less the same as interfaces are used in other languages. > In the latter case I agree with Wiger - allow only one behaviour per module, > but in the former case I am not - allow several behaviours per module. True. Just a thought that might open the can of snakes/worms/dragons : I think there is a difference in semantics for the two usages, maybe it would be appropriate to use different keywords? And also allow for more elaborate handling of "interfaces", like extending them or resolving name clashes. regards, Vlad From fredrik.linder@REDACTED Tue Jul 29 11:24:34 2003 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Tue, 29 Jul 2003 11:24:34 +0200 Subject: behaviours In-Reply-To: Message-ID: From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Vlad Dumitrescu > > From: "Fredrik Linder" > > As an example I'd have: > > > > o One behaviour to list operational functions (start/stop) > > o One behaviour to list administrative functions (set cache size/...) > > o One behaviour for each other functionality (add user/remove user or > > permit_user/is_user_permitted or determine user violations (whatever)) > > > > In this way I'd say that multiple behaviours are very desireable. > > This use of behaviours is more or less the same as interfaces are > used in other > languages. True > Just a thought that might open the can of snakes/worms/dragons : > I think there > is a difference in semantics for the two usages, maybe it would > be appropriate > to use different keywords? ... I've thought about that too, but what is the real difference between interfaces and behaviours? Is it really possible to differentiate the two? Best /Fredrik From richardc@REDACTED Tue Jul 29 11:41:32 2003 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 29 Jul 2003 11:41:32 +0200 (MET DST) Subject: What about Erlang semantics? In-Reply-To: <5.2.0.9.2.20030728153254.025560e8@einfo.com> References: <5.2.0.9.2.20030728153254.025560e8@einfo.com> Message-ID: On Mon, 28 Jul 2003, Byron Hale wrote: > If I understand Erlang semantics, it must have compile time binding to > be functional. However, the mention of Object Orientation concerns me, > because OO programming usually has runtime binding. I'm not sure if I interpret your question correctly, but one answer is that Erlang has runtime (dynamic) binding of calls from one module to another, but compile-time (static) binding of calls within the same module. (This allows runtime code replacement to be done at the module level.) > Also, Erlang appears to have eager evaluation, as it has "soft" > runtime requirements. Yes, Erlang has eager (or "strict") evaluation. /Richard Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://user.it.uu.se/~richardc/ "Having users is like optimization: the wise course is to delay it." -- Paul Graham From vlad_dumitrescu@REDACTED Tue Jul 29 11:59:49 2003 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Tue, 29 Jul 2003 11:59:49 +0200 Subject: behaviours References: Message-ID: From: "Fredrik Linder" > > Just a thought that might open the can of snakes/worms/dragons : > > I think there > > is a difference in semantics for the two usages, maybe it would > > be appropriate > > to use different keywords? ... > > I've thought about that too, but what is the real difference between > interfaces and behaviours? Is it really possible to differentiate the two? I think you did put your finger right on the difference: * defining different (non-overlapping) roles that a process will implement * defining a one-of-several and rather complex basic functionality of a process I'm not sure I captured the meaning in those phrases, but it's a start. Maybe if this interface thing would be pushed to the absurd (or almost there), then gen_server anf friends would be defined by composing in different ways several simpler interfaces, for example 'supervisable' (i.e. can be included in a supervision tree), 'upgradeable', 'callable'... Really hard to do a meaningful split, so I won't go further :-) Using interfaces would probably be most useful in environments with plug-in, dynamic and/or mobile modules - of course one can just use erlang:function_exported, but my feeling is that having a more abstract view could allow for further interesting developments. regards, Vlad From ulf.wiger@REDACTED Tue Jul 29 12:18:09 2003 From: ulf.wiger@REDACTED (Wiger Ulf) Date: Tue, 29 Jul 2003 12:18:09 +0200 Subject: behaviours References: Message-ID: <002101c355ba$b5e57e20$fd7a40d5@telia.com> From: "Fredrik Linder" > One of the uses I have for behaviours is to maintain knowledge > about why a certain function is exported from a module. > > As an example I'd have: > > o One behaviour to list operational functions (start/stop) > o One behaviour to list administrative functions (set cache size/...) > o One behaviour for each other functionality (add user/remove user or > permit_user/is_user_permitted or determine user violations (whatever)) > > In this way I'd say that multiple behaviours are very desireable. > > This could of course be put into separate modules, but doing so distributes > the knowledge that I'd like to keep very close together, and is hence not > desireable. > It'd only make the code more difficult to read and understand. As far as I can tell, this discussion is analogous to the single- vs multiple inheritance debate in OO. The main thing that is missing in order to support use of multiple behaviours in one module is some remapping facility. One could imagine using funs for this in a way that could be transparent and add minimal overhead. Example: -module(ex). -behaviour(a). % expects init/1 and foo/0 -behaviour(b). % expects init/1, foo/0 and bar/0 -export([a_init/1, a_foo/0]). -export([b_init/1, b_foo/0, b_bar/0]). -export([behaviour_redirect/1]). behaviour_redirect(a) -> [{init, 1, fun a_init/1}, {foo, 0, fun a_foo/0}]; behaviour_redirect(b) -> [{init, 1, fun b_init/1}, {foo, 0, fun b_foo/0}, {bar, 0, fun b_bar/0}]. %% Now we can separate overlapping callbacks and group %% the functions in the most intuitive fashion. a_init(Arg) -> ... a_foo() -> ... b_init(Arg) -> ... b_foo() -> ... b_bar() -> ... The behaviour would have to understand to use function_exported(M,behaviour_redirect,1) and use default callbacks for functions that are not explicitly redirected. This operation would be called when the module is "instantiated". It would entail some overhead for behaviours that are not really instantiated (such as mnesia callbacks), but behaviour redirection would not have to be mandatory. /Uffe From fredrik.linder@REDACTED Tue Jul 29 12:58:03 2003 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Tue, 29 Jul 2003 12:58:03 +0200 Subject: behaviours In-Reply-To: <002101c355ba$b5e57e20$fd7a40d5@telia.com> Message-ID: > From: Wiger Ulf [mailto:ulf.wiger@REDACTED] > > As far as I can tell, this discussion is analogous to the single- vs > multiple inheritance debate in OO. True > The main thing that is missing in order to support use of multiple > behaviours in one module is some remapping facility. One could > imagine using funs for this in a way that could be transparent and > add minimal overhead. Example: > > -module(ex). > -behaviour(a). % expects init/1 and foo/0 > -behaviour(b). % expects init/1, foo/0 and bar/0 > > -export([a_init/1, a_foo/0]). > -export([b_init/1, b_foo/0, b_bar/0]). > > -export([behaviour_redirect/1]). > > behaviour_redirect(a) -> > [{init, 1, fun a_init/1}, > {foo, 0, fun a_foo/0}]; > behaviour_redirect(b) -> > [{init, 1, fun b_init/1}, > {foo, 0, fun b_foo/0}, > {bar, 0, fun b_bar/0}]. > > %% Now we can separate overlapping callbacks and group > %% the functions in the most intuitive fashion. > a_init(Arg) -> ... > a_foo() -> ... > > b_init(Arg) -> ... > b_foo() -> ... > b_bar() -> ... > > The behaviour would have to understand to use > function_exported(M,behaviour_redirect,1) and use default callbacks > for functions that are not explicitly redirected. This operation would > be called when the module is "instantiated". It would entail some overhead > for behaviours that are not really instantiated (such as mnesia > callbacks), > but behaviour redirection would not have to be mandatory. Yes, either something like this or promptly deny overlapping behaviours. Maybe even ban using the same function name. Doesn't the given example require that the caller of each of these functions also state on behalf of which behaviour it calls them hence making it overly complex? Something like: init(Settings) -> A = M:init(Settings) using behaviour(a), B = M:init(Settings) using behaviour(b), init_state(Settings, A, B). /Fredrik From fredrik.linder@REDACTED Tue Jul 29 13:11:00 2003 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Tue, 29 Jul 2003 13:11:00 +0200 Subject: behaviours In-Reply-To: Message-ID: > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Vlad Dumitrescu > > From: "Fredrik Linder" > > > Just a thought that might open the can of snakes/worms/dragons : > > > I think there > > > is a difference in semantics for the two usages, maybe it would > > > be appropriate > > > to use different keywords? ... > > > > I've thought about that too, but what is the real difference between > > interfaces and behaviours? Is it really possible to > > differentiate the two? > > I think you did put your finger right on the difference: > * defining different (non-overlapping) roles that a process > will implement > * defining a one-of-several and rather complex basic > functionality of a > process > > I'm not sure I captured the meaning in those phrases, but it's a start. Yeah, maybe. I'm didn't really grasp that either. :-) > Maybe if this interface thing would be pushed to the absurd (or > almost there), > then gen_server anf friends would be defined by composing in > different ways > several simpler interfaces, for example 'supervisable' (i.e. can > be included in > a supervision tree), 'upgradeable', 'callable'... Really hard to do a > meaningful split, so I won't go further :-) Yes, wouldn't this be great? :-) But then again (back to behaviours vs. interfaecs), by just making a small shift of view these new simpler interfaces becomes behaviours, since they too can be implemented having different behaviours. (Each interface having 1+ implementations, each having a different behaviour). > Using interfaces would probably be most useful in environments > with plug-in, > dynamic and/or mobile modules - of course one can just use > erlang:function_exported, but my feeling is that having a more > abstract view > could allow for further interesting developments. This is my feeling too. Regards /Fredrik From sstrollo@REDACTED Tue Jul 29 07:47:43 2003 From: sstrollo@REDACTED (Sebastian Strollo) Date: 28 Jul 2003 22:47:43 -0700 Subject: OT: First Regular Erlang Beer Break In-Reply-To: <07FAE771-C186-11D7-9250-0003938748D4@young-river.com> References: <07FAE771-C186-11D7-9250-0003938748D4@young-river.com> Message-ID: <4wwk7a1j340.fsf@locke.strollo.org> Wow, I can't believe how fast you got back to the keyboard, hmm, I can't believe how fast I got back to it either... :-) Yes, it was very nice to meet you all! Cheers, /Sebastian PS. Thanks for the ride Byron! roger writes: > Just came back from the very first regular erlang beer break. It was > fun to meet some of the folks on this list in person. The beginning > was interesting: spot the engineer in a crowd of about 50 people. The > bad news: it was pretty easy :-) The beer was good, the temparature > chilly. Look forward to the next one. Jim, Byron, Lennart, Sebastian, > Bart, Maurice 't was a pleasure to meet you. > > -Roger From richardc@REDACTED Tue Jul 29 14:43:12 2003 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 29 Jul 2003 14:43:12 +0200 (MET DST) Subject: behaviours In-Reply-To: References: Message-ID: It seems to me that the distinction you're trying to make is between interfaces (i.e., behaviours - they *are* the same) and what is usually known as mixin classes (a form of multiple inheritance of implementations). For further reading, see e.g.: http://citeseer.nj.nec.com/flatt98classe.html http://citeseer.nj.nec.com/246393.html http://erik.prutser.cx/vu/object_oriented_software_development/Mixin%20Classes%20and%20Layered%20Refinement.pdf To be picky, I'd like to remark that we're talking about the behaviour/interface of _modules_, not _processes_, in that a process can be executing code in different modules at different times, and the behaviour of a _process_ (if that's what we want to talk about) must be specified in terms of what messages it receives and sends, and how its state can change. In this respect, it is unfortunate that the term "behaviour" was chosen, but at the same time completely understandable since it was in fact the behaviour of a process, specifically a gen_server-based server, that was on the authors' minds at the time. An interface can describe the set of functions which abstract the interaction with the process (init, call, cast, terminate), so you don't have to call 'spawn' yourself, or explicitly send messages with strange format using the '!' operator, but this is not different from, say, a module with functions for manipulating a simple database, which turns out to be implemented using a 'dets' table. We just don't have a good, general way of specifying real behaviour in a sufficiently abstract and formal way, except for the code itself. So meanwhile, we just specify the interfaces and cross our hearts. Either we live with the fact that interfaces are called "behaviours" in the Erlang world, or we can introduce the declaration "-interface(...)." as a synonym. (Unfortunately it doesn't save any typing either way.) /Richard On Tue, 29 Jul 2003, Fredrik Linder wrote: > > > I've thought about that too, but what is the real difference between > > > interfaces and behaviours? Is it really possible to > > > differentiate the two? > > > > I think you did put your finger right on the difference: > > * defining different (non-overlapping) roles that a process > > will implement > > * defining a one-of-several and rather complex basic > > functionality of a > > process > > > > I'm not sure I captured the meaning in those phrases, but it's a start. > > Yeah, maybe. I'm didn't really grasp that either. :-) > > > Maybe if this interface thing would be pushed to the absurd (or > > almost there), > > then gen_server anf friends would be defined by composing in > > different ways > > several simpler interfaces, for example 'supervisable' (i.e. can > > be included in > > a supervision tree), 'upgradeable', 'callable'... Really hard to do a > > meaningful split, so I won't go further :-) > > Yes, wouldn't this be great? :-) > > But then again (back to behaviours vs. interfaecs), by just making a small > shift of view these new simpler interfaces becomes behaviours, since they > too can be implemented having different behaviours. (Each interface having > 1+ implementations, each having a different behaviour). > > > Using interfaces would probably be most useful in environments > > with plug-in, > > dynamic and/or mobile modules - of course one can just use > > erlang:function_exported, but my feeling is that having a more > > abstract view > > could allow for further interesting developments. > > This is my feeling too. > > Regards > /Fredrik > > Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://user.it.uu.se/~richardc/ "Having users is like optimization: the wise course is to delay it." -- Paul Graham From vlad_dumitrescu@REDACTED Tue Jul 29 15:04:50 2003 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Tue, 29 Jul 2003 15:04:50 +0200 Subject: Building P9C on Windows Message-ID: Hi, I now have successfully built P9C on several Windows systems, XP Home and 2000 Professional, and it works like a charm. Tjohoo!! However there is one thing that I can't get right: after running "./otp_build release", the release directory only has the kernel, compiler, sasl and stdlib applications. Is this intentional, is it a bug, or is it just some detail I have missed? I built the system with "./otp_build boot -a". best regards, Vlad BTW one small detail in REadme.win32: when describing the settings for VC++ to be added to .bashrc, the LIB and INCLUDE variables should have the semicolons escaped too. I just copied the text there and of course it didn't work :-) -------------------------------------------------------------- LIB=$WIN_VCROOT\\VC98\\mfc\\lib\;$WIN_VCROOT\\VC98\\lib INCLUDE=$WIN_VCROOT\\VC98\\atl\\include\;$WIN_VCROOT\\VC98\\mfc\\include\;\ $WIN_VCROOT\\VC98\\include export PATH LIB INCLUDE -------------------------------------------------------------- From fredrik.linder@REDACTED Tue Jul 29 15:07:43 2003 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Tue, 29 Jul 2003 15:07:43 +0200 Subject: behaviours In-Reply-To: Message-ID: > From: Richard Carlsson [mailto:richardc@REDACTED] > > It seems to me that the distinction you're trying to make is between > interfaces (i.e., behaviours - they *are* the same) and what is usually > known as mixin classes (a form of multiple inheritance of > implementations). The distinction was more to sort out the difference between an interface and a behaviour, but as you concluded - they are the same. > In this respect, it is unfortunate that the term "behaviour" was chosen, > but at the same time completely understandable since it was in fact the > behaviour of a process, specifically a gen_server-based server, that was > on the authors' minds at the time. I see, there's the missing piece of my puzzle. Thank you! /Fredrik From vlad_dumitrescu@REDACTED Tue Jul 29 15:34:02 2003 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Tue, 29 Jul 2003 15:34:02 +0200 Subject: behaviours References: Message-ID: ----- Original Message ----- From: "Richard Carlsson" > It seems to me that the distinction you're trying to make is between > interfaces (i.e., behaviours - they *are* the same) and what is usually > known as mixin classes (a form of multiple inheritance of > implementations). Since I think it is me that pushed the discussion in this direction, I will also answer. You are partly right. I am somewhat confused about the terms, but I hope now I managed to clear up my thoughts. Interface = specification of exported functions for a module Behaviour = specification of callback functions that are used together with a generic "main loop" to define the functionality of a process (today the main loop is in gen.erl) That's how I would like to see things, and then there is a difference between the two. Does it make sense? regards, Vlad From jay@REDACTED Tue Jul 29 15:52:18 2003 From: jay@REDACTED (Jay Nelson) Date: Tue, 29 Jul 2003 06:52:18 -0700 Subject: behaviours Message-ID: <4.2.2.20030729064351.00d0d1a0@duomark.com> > It seems to me that the distinction you're trying to make is between > interfaces (i.e., behaviours - they *are* the same) and what is usually > known as mixin classes (a form of multiple inheritance of > implementations). I'd say the modern day morph of mixins is now called Aspect Oriented Programming: http://citeseer.nj.nec.com/kiczales97aspectoriented.html It takes a slightly different twist in that it is a "post-programming" method of fixing up classes consistently to add in a functionality shared by all participating classes. I've wanted to combine AOP, mixins and erlang's functional style to produce ESOO (erlang-style object-oriented) that is a purely function combination of callback plug-ins, but of course it is pushed way down on my to-do list. Sounds a lot like what this behaviours discussion is about -- sharing interfaces, callbacks and plug-ins. jay From richardc@REDACTED Tue Jul 29 15:59:55 2003 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 29 Jul 2003 15:59:55 +0200 (MET DST) Subject: behaviours In-Reply-To: References: Message-ID: On Tue, 29 Jul 2003, Vlad Dumitrescu wrote: > You are partly right. I am somewhat confused about the terms, but I > hope now I managed to clear up my thoughts. > > Interface = specification of exported functions for a module > > Behaviour = specification of callback functions that are used together > with a generic "main loop" to define the functionality of a process > > That's how I would like to see things, and then there is a difference > between the two. Does it make sense? It could make sense, as in "a behaviour is an interface to an agent/process", making a distinction between passive and active. I can't quite see the usefulness of this, though, unless the compiler can be made to actually test properties such as "calling this interface function will return in constant time" (all computational results are passed as messages), or "interface functions do not modify the process state (e.g. the dictionary) of the caller". It might actually be better to use "-interface(...)" in programs, and reserve "behaviour" for the latter meaning, but only informally (at least until we have a better idea of how it can be formalized). /Richard Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://user.it.uu.se/~richardc/ "Having users is like optimization: the wise course is to delay it." -- Paul Graham From bjorn@REDACTED Tue Jul 29 16:32:53 2003 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 29 Jul 2003 16:32:53 +0200 Subject: Building P9C on Windows In-Reply-To: References: Message-ID: "Vlad Dumitrescu" writes: > Hi, > > I now have successfully built P9C on several Windows systems, XP Home and 2000 > Professional, and it works like a charm. Tjohoo!! > > However there is one thing that I can't get right: after running "./otp_build > release", the release directory only has the kernel, compiler, sasl and stdlib > applications. > > Is this intentional, is it a bug, or is it just some detail I have missed? I > built the system with "./otp_build boot -a". Yes, it is intentional. You need to build using "./otp_build release -a". > > BTW one small detail in REadme.win32: when describing the settings for VC++ to > be added to .bashrc, the LIB and INCLUDE variables should have the semicolons > escaped too. I just copied the text there and of course it didn't work :-) Thanks for the correction. We will correct the read me file. /Bjorn > > -------------------------------------------------------------- > > LIB=$WIN_VCROOT\\VC98\\mfc\\lib\;$WIN_VCROOT\\VC98\\lib > > INCLUDE=$WIN_VCROOT\\VC98\\atl\\include\;$WIN_VCROOT\\VC98\\mfc\\include\;\ > $WIN_VCROOT\\VC98\\include > > export PATH LIB INCLUDE > -------------------------------------------------------------- > -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From thomasl_erlang@REDACTED Tue Jul 29 18:36:15 2003 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 29 Jul 2003 09:36:15 -0700 (PDT) Subject: behaviours In-Reply-To: Message-ID: <20030729163615.91449.qmail@web41906.mail.yahoo.com> --- Fredrik Linder wrote: > Good point. Versioning is definitely desired, > perhaps something like: > > behaviour_info(callbacks) -> [{Function, Arity}]; > behaviour_info(version) -> Version; > behaviour_info(_) -> undefined. It would be nice to integrate behaviour versions with applications and releases too. I'm not sure what's right, though. It might be straightforward. (Simply take the vsn attribute?) A complicating case: several versions active in the system at the same time (due to use of legacy code, say). Best, Thomas __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From thomasl_erlang@REDACTED Tue Jul 29 18:44:45 2003 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 29 Jul 2003 09:44:45 -0700 (PDT) Subject: behaviours In-Reply-To: Message-ID: <20030729164445.53883.qmail@web41904.mail.yahoo.com> --- Fredrik Linder wrote: > One of the uses I have for behaviours is to maintain > knowledge about why a > certain function is exported from a module. > > As an example I'd have: > > o One behaviour to list operational functions > (start/stop) > o One behaviour to list administrative functions > (set cache size/...) > o One behaviour for each other functionality (add > user/remove user or > permit_user/is_user_permitted or determine user > violations (whatever)) > > In this way I'd say that multiple behaviours are > very desireable. Good motivation, and a good clarification (snipped) about non-overlapping "roles". I'll just say "me too" :-) I would also add that a behaviour provides/documents a standard way of, or API for, doing some task or providing certain functionality. That is, it doesn't just document the whys and hows of how THIS module does something. Best, Thomas __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From thomasl_erlang@REDACTED Tue Jul 29 18:53:27 2003 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 29 Jul 2003 09:53:27 -0700 (PDT) Subject: behaviours In-Reply-To: Message-ID: <20030729165327.62531.qmail@web41901.mail.yahoo.com> --- Richard Carlsson wrote: > To be picky, I'd like to remark that we're talking > about the > behaviour/interface of _modules_, not _processes_, /.../ Yes. > We just don't have a good, general way of specifying > real behaviour in a > sufficiently abstract and formal way, except for the > code itself. So > meanwhile, we just specify the interfaces and cross > our hearts. It's not always clear what we want to specify either. (And finally, my vote goes to keeping "-behaviour".) Best, Thomas __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From anders_nygren2002@REDACTED Wed Jul 30 02:50:13 2003 From: anders_nygren2002@REDACTED (=?iso-8859-1?q?Anders=20Nygren?=) Date: Wed, 30 Jul 2003 02:50:13 +0200 (CEST) Subject: GS does not work in P9C 2003-07-29 Message-ID: <20030730005013.9339.qmail@web14611.mail.yahoo.com> It seems like GS does not work in P9C-2003-07-29 on Windows XP Home Edition. Try pman:start() or debugger:start() and the emulator hangs. /Anders Nygren _____________________________________________________ G? f?re i k?n och f? din sajt v?rderad p? nolltid med Yahoo! Express Se mer p?: http://se.docs.yahoo.com/info/express/help/index.html From anders_nygren2002@REDACTED Wed Jul 30 03:01:15 2003 From: anders_nygren2002@REDACTED (=?iso-8859-1?q?Anders=20Nygren?=) Date: Wed, 30 Jul 2003 03:01:15 +0200 (CEST) Subject: P9C, documentation comments Message-ID: <20030730010115.27438.qmail@web14603.mail.yahoo.com> The new Reference Manual is really good, I just wish it had arrived a long time ago. But, (there is always a but..), I have some comments. ------------------------------------------------------ erl2003.07.29/doc/reference_manual/data_types.html 2.6 Fun The link to Programming Examples is broken ------------------------------------------------------ erl2003.07.29/doc/reference_manual/expressions.html 6.5 Match Add that Expr1=Expr2=Expr3=.... is a legal expression. e.g. {X,Y}=Res=f() 6.11 Explain how exactly (not) equal differs from "normal" (not) equal. ----------------------------------------------------- erl2003.07.29/doc/reference_manual/records.html 8.3 It says "Expr should evaluateto a Name record." Add that there is no check that it really is a Name record. ------------------------------------------------------ ERTS Users Guide, Match Specifications In section 1.2.1 Says to use record_info(, size) That should be record_info(size,) /Anders Nygren _____________________________________________________ G? f?re i k?n och f? din sajt v?rderad p? nolltid med Yahoo! Express Se mer p?: http://se.docs.yahoo.com/info/express/help/index.html From kent@REDACTED Wed Jul 30 04:36:59 2003 From: kent@REDACTED (Kent Boortz) Date: 30 Jul 2003 04:36:59 +0200 Subject: GS does not work in P9C 2003-07-29 In-Reply-To: <20030730005013.9339.qmail@web14611.mail.yahoo.com> References: <20030730005013.9339.qmail@web14611.mail.yahoo.com> Message-ID: > It seems like GS does not work in P9C-2003-07-29 > on Windows XP Home Edition. > Try pman:start() or debugger:start() and the > emulator hangs. We just did the change so that the Tcl/Tk part of GS will be included in the Windows binary release. If all goes well GS will be working in the next binary snapshot for Windows, kent From vlad_dumitrescu@REDACTED Wed Jul 30 07:58:50 2003 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 30 Jul 2003 07:58:50 +0200 Subject: behaviours References: <20030729163615.91449.qmail@web41906.mail.yahoo.com> Message-ID: ----- Original Message ----- From: "Thomas Lindgren" > --- Fredrik Linder > wrote: > > > Good point. Versioning is definitely desired, > > perhaps something like: > > > > behaviour_info(callbacks) -> [{Function, Arity}]; > > behaviour_info(version) -> Version; > > behaviour_info(_) -> undefined. > > It would be nice to integrate behaviour versions with > applications and releases too. I'm not sure what's > right, though. It might be straightforward. (Simply > take the vsn attribute?) > > A complicating case: several versions active in the > system at the same time (due to use of legacy code, > say). I think this is why COM and CORBA (I think) had to resort to incomprehensible unique identifiers that change with the slightest change of the interface... One can't just say "I implement interface X", but "interface X version Y" and with several developers it gets easily out of hand. And what if someone doesn't update the version? Ouch! This isn't easy. Regards, Vlad From vlad_dumitrescu@REDACTED Wed Jul 30 08:49:28 2003 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 30 Jul 2003 08:49:28 +0200 Subject: Building P9C on Windows References: Message-ID: From: "Bjorn Gustavsson" > You need to build using "./otp_build release -a". Thanks, it worked fine. This option isn't documented either. Another small detail: In the release directory, some applications are labeled 2002.12.08 and since they are the last ones in alphabetical order (ssl, stdlib, toolbar, tools, tv and webtool), I suspect something is wrong with the labeling. best regards, Vlad From dsolaz@REDACTED Wed Jul 30 08:34:03 2003 From: dsolaz@REDACTED (Daniel Solaz) Date: Wed, 30 Jul 2003 08:34:03 +0200 Subject: bug in pid()? Message-ID: <200307300834.03754.dsolaz@sistelcom.com> is this a bug? node1> self(). <0,41,0> node1> global:register_name(shell1, self()). yes node1> global:whereis_name(shell1) == pid(0, 41, 0). true node2> global:whereis_name(shell1) == pid(3822, 41, 0). false comparison is true when pid is local but false when remote tested with R9B-1 and P9C (July 28) on FreeBSD/x86 R9B-1 on Linux/x86 and Linux/HPPA From rvg@REDACTED Wed Jul 30 11:38:34 2003 From: rvg@REDACTED (Rudolph van Graan) Date: Wed, 30 Jul 2003 11:38:34 +0200 Subject: R9C: SSL on Debian Message-ID: <1F42BB97D787C048BCC519FF28048AC367F2@na.sdn.net.za> Hi there, The default ./configure failed to find the installed ssl on a Debian/testing [Linux i686] machine. libssl and libssl-dev are both installed: ii libssl-dev 0.9.7b-2 SSL development libraries, header files and ii libssl0.9.6 0.9.6g-0.woody SSL shared libraries ii libssl0.9.7 0.9.7b-2 SSL shared libraries And can be found in /usr/include/openssl. Had to ./configure --with-ssl=/usr/include/openssl/ Is this as intended? Rgds, R From rvg@REDACTED Wed Jul 30 11:52:29 2003 From: rvg@REDACTED (Rudolph van Graan) Date: Wed, 30 Jul 2003 11:52:29 +0200 Subject: String_to_tuple Message-ID: <1F42BB97D787C048BCC519FF28048AC304EFE9@na.sdn.net.za> Hi all, I have another question today... I was digging through the documentation yesterday trying to find a function that basically does this: 1. Takes as input a string [eg. "{a,b,c}"] and 2. Outputs a term {a,b,c} I did quickly look at the erl_parse and erl_scan functions, but didn't find anything that seems to be able to do this. Basically it is the reverse of io_lib:format("~w",[Term]) that I am looking for... I thought there might be a string_to_tuple or string_to_term function, but no luck for me. Anyone that knows of a simple way to do this? Rgds, R From Chandrashekhar.Mullaparthi@REDACTED Wed Jul 30 12:12:14 2003 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Wed, 30 Jul 2003 11:12:14 +0100 Subject: String_to_tuple Message-ID: 5> String = "{a,b,c}.". "{a,b,c}." 6> 6> {ok, Term, _} = erl_scan:string(String). {ok,[{'{',1},{atom,1,a},{',',1},{atom,1,b},{',',1},{atom,1,c},{'}',1},{dot,1 }],1} 7> 7> erl_parse:parse_term(Term). {ok,{a,b,c}} 8> 8> > -----Original Message----- > From: Rudolph van Graan [mailto:rvg@REDACTED] > Sent: 30 July 2003 10:52 > To: erlang-questions@REDACTED > Subject: String_to_tuple > > > Hi all, > > I have another question today... I was digging through the > documentation > yesterday trying to find a function that basically does this: > > 1. Takes as input a string [eg. "{a,b,c}"] and > 2. Outputs a term {a,b,c} > > I did quickly look at the erl_parse and erl_scan functions, but didn't > find anything that seems to be able to do this. Basically it is the > reverse of > > io_lib:format("~w",[Term]) > > that I am looking for... I thought there might be a string_to_tuple or > string_to_term function, but no luck for me. > > Anyone that knows of a simple way to do this? > > Rgds, > > R > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From kent@REDACTED Wed Jul 30 14:33:25 2003 From: kent@REDACTED (Kent Boortz) Date: 30 Jul 2003 14:33:25 +0200 Subject: R9C: SSL on Debian In-Reply-To: <1F42BB97D787C048BCC519FF28048AC367F2@na.sdn.net.za> References: <1F42BB97D787C048BCC519FF28048AC367F2@na.sdn.net.za> Message-ID: "Rudolph van Graan" writes: > The default ./configure failed to find the installed ssl on a > Debian/testing [Linux i686] machine. > > libssl and libssl-dev are both installed: > > ii libssl-dev 0.9.7b-2 SSL development libraries, header > files and > ii libssl0.9.6 0.9.6g-0.woody SSL shared libraries > ii libssl0.9.7 0.9.7b-2 SSL shared libraries > > And can be found in /usr/include/openssl. > > Had to > > ./configure --with-ssl=/usr/include/openssl/ > > Is this as intended? The version of openssl is not checked if you give --with-ssl. You should use 0.9.7 or later. If you have 0.9.7 could you please send me the output from % /bin/sh -x ./configure i.e. the failing case? Do you have the files /usr/include/openssl/opensslv.h /usr/bin/openssl Is the output from "/usr/bin/openssl version" 0.9.7 something? kent From per@REDACTED Wed Jul 30 15:10:12 2003 From: per@REDACTED (Per Bergqvist) Date: Wed, 30 Jul 2003 16:10:12 +0300 Subject: behaviour again Message-ID: <200307301410.h6UEACT12996@tessla.levonline.com> Hi, the behaviours thread seemed to gain some interested but did not answer my question ... Q: Why would one specify a behaviour without the target module implementing behaviour_info function ? (as in mnesia and megaco). /Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From richardc@REDACTED Wed Jul 30 18:01:10 2003 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 30 Jul 2003 18:01:10 +0200 (MET DST) Subject: Erlang Workshop registration In-Reply-To: References: Message-ID: Remember to register for the PLI 2003 Erlang Workshop in Uppsala, Sweden (http://www.it.uu.se/pli03/erlang.html), August 29. Early registration ends today - not that it matters, since the price is the same. (If you want to attend ICFP/PDP, it does matter!) Go to http://www.it.uu.se/pli03/ and click "On-line registration". See you there! /Richard Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://user.it.uu.se/~richardc/ "Having users is like optimization: the wise course is to delay it." -- Paul Graham From thomasl_erlang@REDACTED Wed Jul 30 19:06:17 2003 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 30 Jul 2003 10:06:17 -0700 (PDT) Subject: behaviour again In-Reply-To: <200307301410.h6UEACT12996@tessla.levonline.com> Message-ID: <20030730170617.13323.qmail@web41903.mail.yahoo.com> --- Per Bergqvist wrote: > Hi, > > the behaviours thread seemed to gain some interested > but did > not answer my question ... > > Q: Why would one specify a behaviour without the > target > module implementing behaviour_info function ? (as in > mnesia and > megaco). Like -module(mnesia). -behaviour(mnesia_access). ... My educated guess is that someone forgot to include mnesia_access.erl in the distribution :-) Best, Thomas __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From dsolaz@REDACTED Wed Jul 30 19:40:23 2003 From: dsolaz@REDACTED (Daniel Solaz) Date: Wed, 30 Jul 2003 19:40:23 +0200 Subject: P9C shell skips last command in history Message-ID: <200307301940.23824.dsolaz@sistelcom.com> possibly a buglet in the shell history code: node> cmd1(). ok node> cmd2(). ok node> at this point, pressing 'up' makes "cmd2()." appear on the command line now press 'down' to return to the empty command line until a new command is executed, 'up' will skip "cmd2()." every time I noticed this in P9C of 28 and 30 July (FreeBSD 4.8); does not happen in R9B-1 -Daniel From per@REDACTED Wed Jul 30 21:43:29 2003 From: per@REDACTED (Per Bergqvist) Date: Wed, 30 Jul 2003 22:43:29 +0300 Subject: behaviour again In-Reply-To: <20030730170617.13323.qmail@web41903.mail.yahoo.com> Message-ID: <200307302043.h6UKhTc21492@tessla.levonline.com> This might be the case for mnesia_access and megaco_encoder but then what about mnesia_backup, mnesia_frag_hash and megaco_user ? My non-educated guess is that mnesia_access and megaco_encoder doesn't even exist. Shouldn't really the behaviours be defined or the behaviour reference be removed ? /Per ------------------- > > --- Per Bergqvist wrote: > > Hi, > > > > the behaviours thread seemed to gain some interested > > but did > > not answer my question ... > > > > Q: Why would one specify a behaviour without the > > target > > module implementing behaviour_info function ? (as in > > mnesia and > > megaco). > > Like > > -module(mnesia). > -behaviour(mnesia_access). > ... > > My educated guess is that someone forgot to include > mnesia_access.erl in the distribution :-) > > Best, > Thomas > > > __________________________________ > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. > http://search.yahoo.com > ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From anders_nygren2002@REDACTED Thu Jul 31 05:20:10 2003 From: anders_nygren2002@REDACTED (=?iso-8859-1?q?Anders=20Nygren?=) Date: Thu, 31 Jul 2003 05:20:10 +0200 (CEST) Subject: Converting string to match specification Message-ID: <20030731032010.68293.qmail@web14602.mail.yahoo.com> I want to be able to take a string containing a fun and convert it to a match specification. Similar to what i can get with the ms_transform parse transform, but I want to make it at runtime. Match=ets:fun2ms(fun (X)->{x,X} end) I have been playing with erl_scan, erl_parse and ms_transform, but I have not been able to get it to work. Any hints? _____________________________________________________ G? f?re i k?n och f? din sajt v?rderad p? nolltid med Yahoo! Express Se mer p?: http://se.docs.yahoo.com/info/express/help/index.html From anders_nygren2002@REDACTED Thu Jul 31 05:22:45 2003 From: anders_nygren2002@REDACTED (=?iso-8859-1?q?Anders=20Nygren?=) Date: Thu, 31 Jul 2003 05:22:45 +0200 (CEST) Subject: P9C documentation comments, Getting started with Erlang Message-ID: <20030731032245.68583.qmail@web14602.mail.yahoo.com> Reading some of the P9C documentation I have found a few small things. Getting Started with Erlang 1.1 Introduction Second para. "The first CHAPTER of the book Concurrent Programming in ERLANG,..." It is the first PART not CHAPTER. 1.2.6 How to get help Could be nice to refer to the Erlang Reference Manual. 1.5.1 Example The links "The Shell Tracer Window" and "Trace of the function ping_pong:ping()." Does not lead to the figs. /Anders Nygren _____________________________________________________ G? f?re i k?n och f? din sajt v?rderad p? nolltid med Yahoo! Express Se mer p?: http://se.docs.yahoo.com/info/express/help/index.html From anders_nygren2002@REDACTED Thu Jul 31 05:50:41 2003 From: anders_nygren2002@REDACTED (=?iso-8859-1?q?Anders=20Nygren?=) Date: Thu, 31 Jul 2003 05:50:41 +0200 (CEST) Subject: Starting Your favorite editor from Erlang Message-ID: <20030731035041.89309.qmail@web14607.mail.yahoo.com> Does anyone know how to start Your favorite editor e.g. Vi or Emacs from an Erlang program and then getting the text back into erlang? I have tried os:cmd("the correct path\gvim.exe") on windows but no succes. /Anders Nygren _____________________________________________________ G? f?re i k?n och f? din sajt v?rderad p? nolltid med Yahoo! Express Se mer p?: http://se.docs.yahoo.com/info/express/help/index.html From sjn@REDACTED Thu Jul 31 06:57:04 2003 From: sjn@REDACTED (Sanjay Mehta) Date: Thu, 31 Jul 2003 10:27:04 +0530 Subject: Starting Your favorite editor from Erlang In-Reply-To: <20030731035041.89309.qmail@web14607.mail.yahoo.com> References: <20030731035041.89309.qmail@web14607.mail.yahoo.com> Message-ID: <3F28A1A0.30208@cypress.com> os:cmd("start gvim"). gvim is in my path. Anders Nygren wrote: > Does anyone know how to start Your favorite editor > e.g. Vi or Emacs from an Erlang program and then > getting the text back into erlang? > > I have tried os:cmd("the correct path\gvim.exe") on > windows but no succes. > > /Anders Nygren > > _____________________________________________________ > G? f?re i k?n och f? din sajt v?rderad p? nolltid med Yahoo! Express > Se mer p?: http://se.docs.yahoo.com/info/express/help/index.html > > From vlad_dumitrescu@REDACTED Thu Jul 31 07:49:24 2003 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Thu, 31 Jul 2003 07:49:24 +0200 Subject: Starting Your favorite editor from Erlang References: <20030731035041.89309.qmail@web14607.mail.yahoo.com> Message-ID: ----- Original Message ----- From: "Anders Nygren" > Does anyone know how to start Your favorite editor > e.g. Vi or Emacs from an Erlang program and then > getting the text back into erlang? > > I have tried os:cmd("the correct path\gvim.exe") on > windows but no succes. Hi, Works fine for me - maybe you used "\" instead of "/"? Erlang file paths are Unix-ish. I'm not sure about what you mean by "getting the text back into Erlang". I use Emacs and Distel directly (i.e. strating Erlang from there, not the other way around) and it works like a charm. regards, Vlad From per@REDACTED Thu Jul 31 08:34:27 2003 From: per@REDACTED (Per Bergqvist) Date: Thu, 31 Jul 2003 09:34:27 +0300 Subject: Starting Your favorite editor from Erlang In-Reply-To: <20030731035041.89309.qmail@web14607.mail.yahoo.com> Message-ID: <200307310734.h6V7YRO02692@tessla.levonline.com> Note that under windows you need to either use forward slash or quote the backward slash. However I think there is a bug regarding long file names with spaces. Only if I use the short equivalent it works. os:cmd("c:\Program Files\XEmacs\XEmacs-21.4.11\i586-pc-win32\xemacs.exe"). %% NOT OK, expected os:cmd("c:\progra~1\XEmacs\XEmacs-21.4.11\i586-pc-win32\xemacs.exe").% % NOT OK, expected os:cmd("c:/Program Files/XEmacs/XEmacs-21.4.11/i586-pc-win32/xemacs.exe"). %% NOT OK BUG os:cmd("c:\\Program Files\\XEmacs\\XEmacs-21.4.11\\i586-pc-win32\\xemacs.exe"). %% NOT OK BUG os:cmd("c:\\progra~1\\XEmacs\\XEmacs-21.4.11\\i586-pc-win32\\xemacs.ex e"). %% OK os:cmd("c:/progra~1/XEmacs/XEmacs-21.4.11/i586-pc-win32/xemacs.exe"). %% OK /Per ------------------- > Does anyone know how to start Your favorite editor > e.g. Vi or Emacs from an Erlang program and then > getting the text back into erlang? > > I have tried os:cmd("the correct path\gvim.exe") on > windows but no succes. > > /Anders Nygren > > _____________________________________________________ > G? f?re i k?n och f? din sajt v?rderad p? nolltid med Yahoo! Express > Se mer p?: http://se.docs.yahoo.com/info/express/help/index.html > ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From vlad_dumitrescu@REDACTED Thu Jul 31 09:54:24 2003 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Thu, 31 Jul 2003 09:54:24 +0200 Subject: Starting Your favorite editor from Erlang References: <200307310734.h6V7YRO02692@tessla.levonline.com> Message-ID: ----- Original Message ----- From: "Per Bergqvist" > However I think there is a bug regarding long file names with > spaces. Only if I use the short equivalent it works. > os:cmd("c:/Program > Files/XEmacs/XEmacs-21.4.11/i586-pc-win32/xemacs.exe"). %% NOT OK BUG > > os:cmd("c:\\Program > Files\\XEmacs\\XEmacs-21.4.11\\i586-pc-win32\\xemacs.exe"). %% NOT OK > BUG You have to escape the white space too. os:cmd("c:/Program\ Files/XEmacs/XEmacs-21.4.11/i586-pc-win32/xemacs.exe"). %% OK os:cmd("c:\\Program\ Files\\XEmacs\\XEmacs-21.4.11\\i586-pc-win32\\xemacs.exe"). %% OK regards, Vlad From thomasl_erlang@REDACTED Thu Jul 31 11:00:36 2003 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 31 Jul 2003 02:00:36 -0700 (PDT) Subject: behaviours In-Reply-To: Message-ID: <20030731090036.67196.qmail@web41903.mail.yahoo.com> --- Vlad Dumitrescu wrote: > I think [backwards compatibility] is why COM and > CORBA (I think) had to > resort to incomprehensible > unique identifiers that change with the slightest > change of the interface... One > can't just say "I implement interface X", but > "interface X version Y" and with > several developers it gets easily out of hand. And > what if someone doesn't > update the version? Ouch! It's a bit nasty, but perhaps a greater problem for COM or CORBA (since I suspect they integrate more pieces of independent/legacy software than Erlang. At least at this time :-). What to do in Erlang? A simple approach might be to detect that multiple versions are required when a release is created and disallow it, or warn. "Lint-like" handling, if you will. A second approach: you specify "-behaviour(B, Vsn)." when you don't want the latest one, and extend the behaviour definition with: behaviour_info({callbacks, Vsn}) -> ... for the legacy cases. The behaviour checker has to be extended to make the right calls. Best, Thomas __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From anders_nygren2002@REDACTED Thu Jul 31 16:25:57 2003 From: anders_nygren2002@REDACTED (=?iso-8859-1?q?Anders=20Nygren?=) Date: Thu, 31 Jul 2003 16:25:57 +0200 (CEST) Subject: Starting Your favorite editor from Erlang In-Reply-To: Message-ID: <20030731142557.80806.qmail@web14601.mail.yahoo.com> --- Vlad Dumitrescu skrev: > ----- Original Message ----- > From: "Anders Nygren" > > Does anyone know how to start Your favorite editor > > e.g. Vi or Emacs from an Erlang program and then > > getting the text back into erlang? > > > > I have tried os:cmd("the correct path\gvim.exe") > on > > windows but no succes. > > Hi, > > Works fine for me - maybe you used "\" instead of > "/"? Erlang file paths are > Unix-ish. > > I'm not sure about what you mean by "getting the > text back into Erlang". I use > Emacs and Distel directly (i.e. strating Erlang from > there, not the other way > around) and it works like a charm. > > regards, > Vlad Thanks to everyone for the help. Vlad, regarding Your question, what I am planning is for an erlang program to open an editor, so the user can edit some configuration data in their favorite editor. When the user has finished editing my app will get the data and act on it. It would be cool if I could get the edited text in the reply from os:cmd(), but for now I will just read the file again when os:cmd returns. /Anders _____________________________________________________ G? f?re i k?n och f? din sajt v?rderad p? nolltid med Yahoo! Express Se mer p?: http://se.docs.yahoo.com/info/express/help/index.html From DANIESC.SCHUTTE@REDACTED Thu Jul 31 16:58:52 2003 From: DANIESC.SCHUTTE@REDACTED (DANIESC SCHUTTE) Date: Thu, 31 Jul 2003 16:58:52 +0200 Subject: Resource Sharing Between production and test environment Message-ID: Good afternoon all, I would like to know if the following scenario would be possible without using tcp/ip connections (gen_tcp connections). We have a production system setup and a separate test system setup. We do however have only 1 x USSD shortcode coming into our production environment - what we are trying to do - is USSD's from certain MSISDN's need to be "routed" to the test environment for end to end testing. We have the production environment routing the information to a node on the test environment - but it seems as if we have a cookie issue - as sometimes - the production environment hijacs the similarly called nodes in the test environment. Is it possible to have a node becoming a "bridge" node between the two systems and ensuring that the two systems do not hijack each other? The problem is solved by using tcp/ip connections - but we would prefer the more elegant erlang approach. Thanks Daniel ##################################################################################### The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy or copies. ##################################################################################### From fredrik.linder@REDACTED Thu Jul 31 16:55:29 2003 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Thu, 31 Jul 2003 16:55:29 +0200 Subject: behaviours In-Reply-To: <20030731090036.67196.qmail@web41903.mail.yahoo.com> Message-ID: > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Thomas Lindgren > > A second approach: you specify "-behaviour(B, Vsn)." > when you don't want the latest one, and extend the > behaviour definition with: > > behaviour_info({callbacks, Vsn}) -> ... > > for the legacy cases. The behaviour checker has to be > extended to make the right calls. Actually, shouldn't the version ALWAYS be there? Stating which version of the behaviour the code actually was written for. /Fredrik From svg@REDACTED Thu Jul 31 17:02:26 2003 From: svg@REDACTED (Vladimir Sekissov) Date: Thu, 31 Jul 2003 21:02:26 +0600 (YEKST) Subject: Converting string to match specification In-Reply-To: <20030731032010.68293.qmail@web14602.mail.yahoo.com> References: <20030731032010.68293.qmail@web14602.mail.yahoo.com> Message-ID: <20030731.210226.80896050.svg@surnet.ru> Good day, Please look at function source of dbg:fun2ms/1 in runtime_tools/src/dbg.erl You need simply change ?MODULE(== dbg) to `ets' at line 48. Best Regards, Vladimir Sekissov anders_nygren2002> I want to be able to take a string containing a fun anders_nygren2002> and convert it to a match specification. anders_nygren2002> Similar to what i can get with the ms_transform parse anders_nygren2002> transform, but I want to make it at runtime. anders_nygren2002> Match=ets:fun2ms(fun (X)->{x,X} end) anders_nygren2002> anders_nygren2002> I have been playing with erl_scan, erl_parse and anders_nygren2002> ms_transform, but I have not been able to get it to anders_nygren2002> work. Any hints? anders_nygren2002> anders_nygren2002> anders_nygren2002> anders_nygren2002> _____________________________________________________ anders_nygren2002> G? f?re i k?n och f? din sajt v?rderad p? nolltid med Yahoo! Express anders_nygren2002> Se mer p?: http://se.docs.yahoo.com/info/express/help/index.html From Chandrashekhar.Mullaparthi@REDACTED Thu Jul 31 17:42:09 2003 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Thu, 31 Jul 2003 16:42:09 +0100 Subject: Resource Sharing Between production and test environment Message-ID: > -----Original Message----- > From: DANIESC SCHUTTE [mailto:DANIESC.SCHUTTE@REDACTED] > > We have the production environment routing the information to > a node on the test environment - but it seems as if we have a > cookie issue - as sometimes - the production environment > hijacs the similarly called nodes in the test environment. > what do you mean by this? Can you elaborate a bit more? Chandru NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From svg@REDACTED Thu Jul 31 18:15:44 2003 From: svg@REDACTED (Vladimir Sekissov) Date: Thu, 31 Jul 2003 22:15:44 +0600 (YEKST) Subject: Converting string to match specification In-Reply-To: <20030731.210226.80896050.svg@surnet.ru> References: <20030731032010.68293.qmail@web14602.mail.yahoo.com> <20030731.210226.80896050.svg@surnet.ru> Message-ID: <20030731.221544.45333040.svg@surnet.ru> Opps, sorry, I forgot code. -module(test). -export([str2ms/1]). str2ms(FunStr) -> {ok, Tokens, _} = erl_scan:string(FunStr), {ok, [Form]} = erl_parse:parse_exprs(Tokens), {'fun', _, {clauses, Clauses}} = Form, case ms_transform:transform_from_shell(ets, Clauses, []) of {error,[{_,[{_,_,Code}|_]}|_],_} -> io:format("Error: ~s~n", [ms_transform:format_error(Code)]), {error,transform_error}; Else -> Else end. (svg@REDACTED)17> test:str2ms("fun (X) -> {x, X} end."). [{'$1',[],[{{x,'$1'}}]}] Best Regards, Vladimir Sekissov svg> Please look at function source of svg> svg> dbg:fun2ms/1 in runtime_tools/src/dbg.erl svg> svg> You need simply change ?MODULE(== dbg) to `ets' at line 48. svg> svg> Best Regards, svg> Vladimir Sekissov svg> svg> anders_nygren2002> I want to be able to take a string containing a fun svg> anders_nygren2002> and convert it to a match specification. svg> anders_nygren2002> Similar to what i can get with the ms_transform parse svg> anders_nygren2002> transform, but I want to make it at runtime. svg> anders_nygren2002> Match=ets:fun2ms(fun (X)->{x,X} end) svg> anders_nygren2002> svg> anders_nygren2002> I have been playing with erl_scan, erl_parse and svg> anders_nygren2002> ms_transform, but I have not been able to get it to svg> anders_nygren2002> work. Any hints? svg> anders_nygren2002> svg> anders_nygren2002> svg> anders_nygren2002> svg> anders_nygren2002> _____________________________________________________ svg> anders_nygren2002> G? f?re i k?n och f? din sajt v?rderad p? nolltid med Yahoo! Express svg> anders_nygren2002> Se mer p?: http://se.docs.yahoo.com/info/express/help/index.html From hal@REDACTED Thu Jul 31 18:49:31 2003 From: hal@REDACTED (Hal Snyder) Date: Thu, 31 Jul 2003 11:49:31 -0500 Subject: Resource Sharing Between production and test environment In-Reply-To: ("DANIESC SCHUTTE"'s message of "Thu, 31 Jul 2003 16:58:52 +0200") References: Message-ID: <874r12k5es.fsf@ghidra.vail> "DANIESC SCHUTTE" writes: > Is it possible to have a node becoming a "bridge" node between the > two systems and ensuring that the two systems do not hijack each > other? > > The problem is solved by using tcp/ip connections - but we would > prefer the more elegant erlang approach. I haven't tried it but we are inexorably headed for the same sort of problem for different reasons. I suspect the erlang cookie notion will disappear. One enterprise, one cookie. Otherwise you throw away too many useful interactions. Question is whether the hidden node construct is flexible to allow you to divide a single-cookie system acceptably. Mnesia may be a problem - AFAIK you need a single schema for all nodes, although replication can be customized per table. This might help, from the list Fri, 20 Apr 2001: http://www.erlang.org/ml-archive/erlang-questions/200104/msg00069.html But I would love to hear from other regarding hidden nodes, etc. From anders_nygren2002@REDACTED Thu Jul 31 21:59:10 2003 From: anders_nygren2002@REDACTED (=?iso-8859-1?q?Anders=20Nygren?=) Date: Thu, 31 Jul 2003 21:59:10 +0200 (CEST) Subject: Converting string to match specification In-Reply-To: <20030731.221544.45333040.svg@surnet.ru> Message-ID: <20030731195910.49629.qmail@web14601.mail.yahoo.com> --- Vladimir Sekissov skrev: > Opps, sorry, I forgot code. > > -module(test). > > -export([str2ms/1]). > > str2ms(FunStr) -> > {ok, Tokens, _} = erl_scan:string(FunStr), > {ok, [Form]} = erl_parse:parse_exprs(Tokens), > {'fun', _, {clauses, Clauses}} = Form, > case ms_transform:transform_from_shell(ets, > Clauses, []) of > {error,[{_,[{_,_,Code}|_]}|_],_} -> > io:format("Error: ~s~n", > [ms_transform:format_error(Code)]), > {error,transform_error}; > Else -> > Else > end. > > > (svg@REDACTED)17> test:str2ms("fun (X) -> {x, X} > end."). > [{'$1',[],[{{x,'$1'}}]}] > Thank You Vlad, Unfortunately it does not completely solve my problem, because ms_transform_from_shell does not allow records. I was not clear in my first email, what I want is something similar to. -module(test). -include("..../event.hrl"). -export([do/0]). do()-> ets:fun2ms("fun (X) when is_record(X,event) -> {foo,X,bar} end."). /Anders _____________________________________________________ G? f?re i k?n och f? din sajt v?rderad p? nolltid med Yahoo! Express Se mer p?: http://se.docs.yahoo.com/info/express/help/index.html From per@REDACTED Thu Jul 31 21:25:56 2003 From: per@REDACTED (Per Bergqvist) Date: Thu, 31 Jul 2003 22:25:56 +0300 Subject: Resource Sharing Between production and test environment In-Reply-To: Message-ID: <200307312025.h6VKPuw19733@tessla.levonline.com> I think routing the ussd requests over a gen_tcp tcp/ip connection is a good and elegant way of solving the problem. Especially if you use packet mode and term_to_binary/binary_to_term :-) You should absolutely not attempt to solve the problem with distributed erlang since it may potentially severely impact the production system. (e.g. gdb debugging a node in the test system could potentially stall global locking on all other connected nodes.) Use /etc/hosts file on all test machines to fake the hosts names on the hosts in the test system if you really require identical naming of all hosts. as long as the host naming is separated between the two systems it should not be possible to have "hijacked" nodes even if they use the same cookies (which they shouldn't if you want to be damn sure). /Per ------------------- > Good afternoon all, > > I would like to know if the following scenario would be possible without using tcp/ip connections (gen_tcp connections). > > We have a production system setup and a separate test system setup. We do however have only 1 x USSD shortcode coming into our production environment - what we are trying to do - is USSD's from certain MSISDN's need to be "routed" to the test environment for end to end testing. > > We have the production environment routing the information to a node on the test environment - but it seems as if we have a cookie issue - as sometimes - the production environment hijacs the similarly called nodes in the test environment. > > Is it possible to have a node becoming a "bridge" node between the two systems and ensuring that the two systems do not hijack each other? > > The problem is solved by using tcp/ip connections - but we would prefer the more elegant erlang approach. > > Thanks > Daniel > > ###################################################################### ############### > The information contained in this message and or attachments is intended > only for the person or entity to which it is addressed and may contain > confidential and/or privileged material. Any review, retransmission, > dissemination or other use of, or taking of any action in reliance upon, > this information by persons or entities other than the intended recipient > is prohibited. If you received this in error, please contact the sender and > delete the material from any system and destroy or copies. > ###################################################################### ############### > ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From svg@REDACTED Thu Jul 31 22:19:07 2003 From: svg@REDACTED (Vladimir Sekissov) Date: Fri, 01 Aug 2003 02:19:07 +0600 (YEKST) Subject: Converting string to match specification In-Reply-To: <20030731195910.49629.qmail@web14601.mail.yahoo.com> References: <20030731.221544.45333040.svg@surnet.ru> <20030731195910.49629.qmail@web14601.mail.yahoo.com> Message-ID: <20030801.021907.06968837.svg@surnet.ru> Element guard could give you mostly the same result: (svg@REDACTED)19> test:str2ms("fun (X) when element(1, X) == event -> {x, X} end."). [{'$1',[{'==',{element,1,'$1'},event}],[{{x,'$1'}}]}] You can add size/1 bif if want to get exact result: (svg@REDACTED)20> test:str2ms("fun (X) when element(1, X) == event, size(X) == 3 -> {x, X} end."). [{'$1',[{'==',{element,1,'$1'},event},{'==',{size,'$1'},3}],[{{x,'$1'}}]}] Best Regards, Vladimir Sekissov anders_nygren2002> I was not clear in my first email, what I want is anders_nygren2002> something similar to. anders_nygren2002> -module(test). anders_nygren2002> -include("..../event.hrl"). anders_nygren2002> -export([do/0]). anders_nygren2002> anders_nygren2002> do()-> anders_nygren2002> ets:fun2ms("fun (X) when is_record(X,event) -> anders_nygren2002> {foo,X,bar} anders_nygren2002> end."). anders_nygren2002> anders_nygren2002> anders_nygren2002> /Anders anders_nygren2002> anders_nygren2002> _____________________________________________________ anders_nygren2002> G? f?re i k?n och f? din sajt v?rderad p? nolltid med Yahoo! Express anders_nygren2002> Se mer p?: http://se.docs.yahoo.com/info/express/help/index.html From per@REDACTED Thu Jul 31 21:38:27 2003 From: per@REDACTED (Per Bergqvist) Date: Thu, 31 Jul 2003 22:38:27 +0300 Subject: Starting Your favorite editor from Erlang In-Reply-To: Message-ID: <200307312038.h6VKcRh20014@tessla.levonline.com> Hi, Yeah, you're right. Whitespace should be quoted as well. Unfortunately this does not work for me on Windows XP. The short form of the directory name without whitespace works. Does it work for anybody with whitespace in directory names ??? /Per ------------------- > ----- Original Message ----- > From: "Per Bergqvist" > > However I think there is a bug regarding long file names with > > spaces. Only if I use the short equivalent it works. > > > os:cmd("c:/Program > > Files/XEmacs/XEmacs-21.4.11/i586-pc-win32/xemacs.exe"). %% NOT OK BUG > > > > os:cmd("c:\\Program > > Files\\XEmacs\\XEmacs-21.4.11\\i586-pc-win32\\xemacs.exe"). %% NOT OK > > BUG > > You have to escape the white space too. > > os:cmd("c:/Program\ Files/XEmacs/XEmacs-21.4.11/i586-pc-win32/xemacs.exe"). %% > OK > > os:cmd("c:\\Program\ Files\\XEmacs\\XEmacs-21.4.11\\i586-pc-win32\\xemacs.exe"). > %% OK > > regards, > Vlad > ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From hal@REDACTED Thu Jul 31 23:25:41 2003 From: hal@REDACTED (Hal Snyder) Date: Thu, 31 Jul 2003 16:25:41 -0500 Subject: Resource Sharing Between production and test environment In-Reply-To: <200307312025.h6VKPuw19733@tessla.levonline.com> (Per Bergqvist's message of "Thu, 31 Jul 2003 22:25:56 +0300") References: <200307312025.h6VKPuw19733@tessla.levonline.com> Message-ID: <877k5yie22.fsf@ghidra.vail> Per Bergqvist writes: > You should absolutely not attempt to solve the problem with > distributed erlang since it may potentially severely impact the > production system. (e.g. gdb debugging a node in the test system > could potentially stall global locking on all other connected > nodes.) Could you explain a little more what might cause global locking to stall, and what parts of OTP are affected? You don't need gdb to take a node offline at an inopportune moment. :-0