From joe@REDACTED Mon Mar 1 15:29:38 1999 From: joe@REDACTED (Joe Armstrong) Date: Mon, 1 Mar 1999 15:29:38 +0100 (MET) Subject: Leex in parser tutorial 1.0 In-Reply-To: Message-ID: On Mon, 22 Feb 1999 mickael_remond@REDACTED wrote: > I did not manage to figure out how to use leex in the parser tutorial > contrib. > > The make function in ecc_parse refers to leex:gen, but there is no > leex.erl. There is only a leex.hrl in the directory, with no gen function > exported. > > What should I do to run this complete example (the yecc part seems to > produce a valide parser by the way). > > Thanks in advance for your help. > > Micka?l R?mond > > Sorry - leex.erl *is* in the distribution but well hidden! It's in the archive http://www.erlang.org/examples/examples-2.0.tgz /Joe -- Joe Armstrong Computer Science Laboratory +46 8 719 9452 AT2/ETX/DN/SU Ericsson Telecom SE-126 25 Stockholm Sweden joe@REDACTED http://www.ericsson.se/cslab/~joe From tonyp@REDACTED Wed Mar 3 14:38:03 1999 From: tonyp@REDACTED (Tony Pedley) Date: Wed, 03 Mar 1999 13:38:03 +0000 Subject: ObjectTime/UML/Erlang Message-ID: <36DD3B3B.E46E3B31@terminus.ericsson.se> Hi We are currently investigating Erlang projects and at the same time looking at our development tools. One tool we are currently interested in is ObjectTime, which from the demonstration's we have seen is a very sophisticated analysis and design tool. However the UML diagrams are converted down to C/C++. >From our discussions it is said to be feasible to use other languages, although a lot of work would be required, and were wondering if anyone had looked in to it or indeed any work at all in UML-Erlang conversion. All the best Tony P.S After a week of using Erlang, I'm impressed. Now I have to convince everyone else:)[C++ looks better on CV's] -- ______________________________________________________________________ Tony Pedley mailto:tonyp@REDACTED Ericsson Intracom Ltd. Intranet : http://intracom.ericsson.se 1 Bede Island Internet : http://www.ericsson.co.uk/datacom/index.htm Leicester memoID : ECOM.CBERAM England Tel : +44 (0)116 2 542 400 LE2 7EU Fax : +44 (0)116 2 046 111 ______________________________________________________________________ From ulf.wiger@REDACTED Wed Mar 3 15:18:19 1999 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Wed, 03 Mar 1999 15:18:19 +0100 Subject: ObjectTime/UML/Erlang References: <36DD3B3B.E46E3B31@terminus.ericsson.se> Message-ID: <36DD44AB.FD9046AD@etxb.ericsson.se> Tony Pedley wrote: > > Hi > > We are currently investigating Erlang projects and at the same time > looking at our development tools. One tool we are currently interested > in > is ObjectTime, which from the demonstration's we have seen is a very > sophisticated > analysis and design tool. However the UML diagrams are converted down to > C/C++. > >From our discussions it is said to be feasible to use other languages, > although a > lot of work would be required, and were wondering if anyone had looked > in to it or indeed > any work at all in UML-Erlang conversion. Yes, there has (or at least partially). We looked into using Rational Rose for Erlang development. At the time, Rose supported only the Booch notation, but we did at least discuss UML and decided that our conclusions would hold for UML as well. I might add that a study was presented at the latest Erlang User Conference, which used TeleLogic's SDT to develop an Erlang program. It didn't look too shabby, since SDL and Erlang are similar in many respects. But at least for now, generating Erlang from SDL/PR requires more work than it would take to write the Erlang programs from scratch. Having said that, though, it wouldn't be fair not to also count the time it takes to document your program design. Using SDT, much of the documentation is done as an integral part of the design work, and SDT *is* capable of generating working Erlang programs from a complete specification. I've included some quotes from the study of Booch/Rational Rose. Some of the conclusions are based on what Rational Rose actually supports (e.g. it doesn't support code generation from sequence charts). ObjectTime might be better in some regards -- I don't know: "Conclusion ---------- We do not recommend adapting Rational tools to Erlang at this time. It is not yet clear whether it will be feasible to go both back and forth between Booch/OMT analysis models and Erlang code, and it is not obvious that the design model used in Rational tools would promote good Erlang program design. Furthermore, Rational offers little support for the primary specification standards in the telecommunications field. "We propose a pilot project aimed at improving existing Erlang design and analysis tools, and suggest consideration of a few other design and analysis products, such as TeleLogic's SDL Design Tool and Verilog's ObjectGeode. Both tools support SDL (ObjectGeode also supports OMT), which is widely used in the telecom industry, and for which there is already an experimental link to Erlang." "The most common issues raised to Erlang consultants at large Ericsson projects concern support for the standard description methods and verification tools used in the telecom world. While some low-level support has been developed in the form of programming support for ASN.1, SNMP and yacc-style grammars, little support exists for the use of verifiable high-level design models. Whether the Booch and OMT design models are verifiable is outside the scope of this paper, but there exists no support for model verification in Rose. Furthermore, there is no built-in support for the standards mentioned above, nor does Rose allow designers to specify detailed functional behavior in the graphical model. "This point is not unimportant. One of the primary strengths of functional programming languages is that they are (at least theoretically) verifiable. No doubt this quality contributes to the ease with which one can write robust applications in Erlang. When designing complex systems, it is essential that powerful methods exist to verify that the product will actually behave as intended. This can be accomplished in various ways, for example by comparing run-time behavior with the model specification, or by processing the model with some verification algorithm (e.g. automatic normalization of an E-R schema). While it is dangerous to rely too much on the promise of "software which writes itself", it would be foolish to revert back to a modeling and implementation style which is provably unverifiable. It is thus reasonable to strive for this property at all levels of the development process. "The remaining discussion focuses mainly on the link between Rose diagrams and Erlang programs. It appears as if it would be possible to make Rational Rose generate Erlang "code" from a design document, provided the designer adheres to certain guidelines. Whether it is practically feasible to reverse-engineer diagrams from Erlang code requires more study. It is essential that the design tools fully support a rapid prototyping process without imposing unnecessary restrictions on the programmer. We believe that the adaptation of Rational Rose for Erlang development would most likely be imperfect, forcing the individual designer/programmer to remember which models and programming constructs do not translate well between the two environments. "Currently, Rational Rose generates code for class and type declarations, method interfaces and function heads. While the graphical model supports MSCs and state diagrams, no code is generated for these entities. Since their description is stored in a parsable ASCII format, it might be possible to work around this limitation. In general, we observe that: - class and type declarations are of little use in Erlang, since it requires little in that regard. - method interfaces are useful, but can easily be written by hand (a typical Erlang module might have 1 - 5 lines of export declarations). - generated function heads are useful only as placeholders. Erlang uses alternative function declarations where patterns in the function arguments determine the function's behavior. Since Rose does not support specification of functional behavior, these patterns cannot be generated by Rose and must be written by hand. - message sequence charts and state diagrams could be used to generate a significant volume of Erlang code, which is tedious to write by hand. Unfortunately, Rose generates no such code today. Furthermore, Rose supports very little detail in these models, so generated code would still be very spartan." "When inspecting the actual design model upon which Rational Rose is based, some key areas of concern are identified: - Impact on Productivitiy and Code Quality ? The design model must promote good Erlang programming style; - Differences in Design Philosophy ? it is imperative that the engineering tools used are capable of generating good Erlang code, as well as reverse-engineer design models from good Erlang code; - Differences in the Problem Domain ? It is easy to write Erlang code based on a good problem definition; thus, automatically generating skeleton code does not necessarily reduce the work effort, but could potentially promote good programming conventions; - Different relationship between static and dynamic properties ? Rational tools were designed primarily for storngly typed languages. Erlang is dynamically typed, which shifts the balance between static and dynamic behavior; - Conflicting terminology and symbology which cannot be used as intended can be confusing to developers." > P.S After a week of using Erlang, I'm impressed. Now I have to convince > everyone else:)[C++ looks better on CV's] Well, but I always though that the best CV is the one that focuses on accomplishments. With Erlang, you can accomplish more. ;) /Uffe -- Ulf Wiger, Chief Designer AXD 301 Ericsson Telecom AB tfn: +46 8 719 81 95 Varuv?gen 9, ?lvsj? mob: +46 70 519 81 95 S-126 25 Stockholm, Sweden fax: +46 8 719 43 44 From popovic@REDACTED Mon Mar 8 20:24:01 1999 From: popovic@REDACTED (Igor Popovic) Date: Mon, 08 Mar 1999 13:24:01 -0600 Subject: emacs Erlang mode Message-ID: <36E423D0.361815AE@earthlink.net> Greetings, would a kind soul point me to the right spot to look for the erlang mode for emacs, which according to the FAQ is to be found in $ERL_TOP/emacs? I don't seem to have that directory. TIA, Igor From tobbe@REDACTED Tue Mar 9 06:29:32 1999 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Tue, 09 Mar 1999 16:29:32 +1100 Subject: emacs Erlang mode In-Reply-To: <36E423D0.361815AE@earthlink.net> References: <36E423D0.361815AE@earthlink.net> Message-ID: <199903090529.QAA14898@universe.serc.rmit.edu.au> Do a: find $(ERL_DIR) -name erlang.el -print On my system (*nix) it is located at: $(ERL_DIR)/emacs/erlang.el But I know that on windows you'll find it on: $(ERL_DIR)/misc/emacs/erlang.el /Tobbe From seb@REDACTED Tue Mar 9 10:12:25 1999 From: seb@REDACTED (Sebastian Strollo) Date: 09 Mar 1999 10:12:25 +0100 Subject: emacs Erlang mode In-Reply-To: Igor Popovic's message of Mon, 08 Mar 1999 13:24:01 -0600 References: <36E423D0.361815AE@earthlink.net> Message-ID: Igor Popovic writes: > > would a kind soul point me to the right spot to look for the erlang mode > for emacs, which according to the FAQ is to be found in $ERL_TOP/emacs? > I don't seem to have that directory. By "$ERL_TOP" we mean "the top directory of the unpacked Erlang source code". I.e. if you unpacked erlang_base-47.4.1.src.tar.gz in /home/seb you would find all the emacs stuff in /home/seb/erlang-47.4.1/emacs/. I don't know if the emacs mode comes with the rpms [anyone else?]. Also, note that if you build and install the source code, the emacs mode is *not* installed automatically. cheers, -- Sebastian From paf@REDACTED Tue Mar 9 11:13:46 1999 From: paf@REDACTED (Paulo Ferreira) Date: Tue, 9 Mar 1999 10:13:46 +0000 Subject: Erlang windows install ? Message-ID: <199903091003.KAA21944@groucho.dei.isep.ipp.pt> I need to install erlang in a NT/95 network so I installed Erlang on a shared directory on the server, and would like to change the registry and the path of the client machines, instead of installing Erlang in all of them. Is that possible ? What is needed so that Erlang can run ? Thanks for a very nice language. Paulo Ferreira ================================================== Paulo Ferreira paf@REDACTED From mattias@REDACTED Tue Mar 9 12:30:21 1999 From: mattias@REDACTED (Mattias Nilsson) Date: Tue, 09 Mar 1999 12:30:21 +0100 Subject: Erlang windows install ? References: <199903091003.KAA21944@groucho.dei.isep.ipp.pt> Message-ID: <36E5064D.681C28D7@erix.ericsson.se> Paulo Ferreira wrote: > > I need to install erlang in a NT/95 network so I installed Erlang on a > shared directory on the server, and would like to change the registry > and the path of the client machines, instead of installing Erlang in all > of them. Is that possible ? What is needed so that Erlang can run ? Hi First, you'll probably have to mount the network directory to a drive letter, and not use Windows network paths (\\Host\share style), as the code_server cannot handle Windows network paths (actually it's the 'filename' module's fault, perhaps you'll be able to fix it). When it comes to the registry, you'll need atleast 4 keys in the HKEY_LOCAL_MACHINE\SOFTWARE\Ericsson\Erlang\$VERSION subkey: Rootdir - $ERL_ROOT Bindir - $ERL_ROOT/erts-xxx/bin Emulator - "jam" Progname - "erl" That should do it. -- Mattias From seb@REDACTED Thu Mar 11 12:53:16 1999 From: seb@REDACTED (Sebastian Strollo) Date: 11 Mar 1999 12:53:16 +0100 Subject: emacs Erlang mode In-Reply-To: Colin Paul Adams's message of 10 Mar 1999 19:47:21 +0000 References: <36E423D0.361815AE@earthlink.net> Message-ID: The Emacs mode is now available separately! Since the emacs mode is not included in the RPMs I have put it up separately at the bottom of the download page, http://www.erlang.org/download.html (I have also updated the FAQ accordingly) -- Sebastian From bparsia@REDACTED Mon Mar 15 15:33:34 1999 From: bparsia@REDACTED (Bijan Parsia) Date: Mon, 15 Mar 1999 09:33:34 -0500 Subject: Other missing stuff (Re: emacs Erlang mode) In-Reply-To: Message-ID: Hello: It looks like Jive may not have made it into the Linux distribution either. At least, I had to pull my current copy out of my older installation. I notice that the Java api docs link is broken viz: http://www.erlang.org/doc/doc/lib/jive-1.2/doc/javadoc/Package-jive.erlang.htm Cheers, Bijan Parsia P.S. It would be nice to have the Erlang Extensions docs in HTML again, as well as pdf. From mikl@REDACTED Thu Mar 18 21:55:09 1999 From: mikl@REDACTED (Mickael Remond) Date: Thu, 18 Mar 1999 21:55:09 +0100 Subject: Borsalino : An Erlang business project. Message-ID: <19990318215509.D558@borsa.home> Dear Erlang-er, After numerous tests and experiments with Erlang and other languages, I have finally choosen this language as a basis for my business tools developments. So, in case your are interested, you should have a look at : http://linuxfr.8304.ch/prj/borsalino/index.html unfortunately, the text is only in french for the moment. There is an english summary at: http://linuxfr.8304.ch/prj/borsalino/summary.html You can also find a Swedish version of the summary, written by a friend of mine. This is a way to thank people at Ericsson for their work on Erlang. I hope Erlang will grow and spread quickly. med v?nliga h?lsingar Micka?l R?mond From klacke@REDACTED Fri Mar 19 10:47:08 1999 From: klacke@REDACTED (Claes Wikstrom) Date: Fri, 19 Mar 1999 10:47:08 +0100 (MET) Subject: Borsalino : An Erlang business project. In-Reply-To: <19990318215509.D558@borsa.home> References: <19990318215509.D558@borsa.home> Message-ID: <14066.7452.291764.678026@gin> Mickael Remond writes: > Dear Erlang-er, > > After numerous tests and experiments with Erlang and other languages, > I have finally choosen this language as a basis for my business tools > developments. > > So, in case your are interested, you should have a look at : > http://linuxfr.8304.ch/prj/borsalino/index.html This is very nice to hear, I wish you the best of luck and congratulate you to a wise language selection decision :-) What about GUI for this type of business like apps. Is "etk" (using tk 4.2) good enogh ??? I had a look at the swing GUI libs for java the other day and I must say that that sort of GUI looks nice on screen but absoulutley horrible in the source code. Gazzilion little instantiations of unknown classes with unknown side effects .. ... arghhh. /klacke From patrickdlogan@REDACTED Fri Mar 19 19:22:50 1999 From: patrickdlogan@REDACTED (patrickdlogan@REDACTED) Date: Fri, 19 Mar 1999 10:22:50 -0800 (PST) Subject: Borsalino : An Erlang business project. In-Reply-To: <14066.7452.291764.678026@gin> References: <19990318215509.D558@borsa.home> <14066.7452.291764.678026@gin> Message-ID: <14066.36510.995874.325029@c837917-a.potlnd1.or.home.com> I am interested in discussing the following GUI issue. It may not be appropriate for the erlang-questions list. If you strongly feel this should be, or should not be, a part of this mail list, privately respond to me. I'll tally the results. We could have an "off line" email discussion and then post a summary back to this list. Claes Wikstrom writes: > > > After numerous tests and experiments with Erlang and other languages, > > I have finally choosen this language as a basis for my business tools > > developments. > > What about GUI for this type of business like apps. Is "etk" > (using tk 4.2) good enogh ??? I think it is important to keep in mind the changing landscape of office systems (as well as home systems, SOHO). Smaller client systems, remote clients, ever-smaller "clients" that have the capability of running as a "server", etc. I think it is important to keep a clear separation between the business end and the input/output end. That way, a client could be Tk, TCL/Tk, HTML 3.2, XML, Java, or whatever. > I had a look at the swing GUI libs for java the other day > and I must say that that sort of GUI looks nice on screen but > absoulutley horrible in the source code. Gazzilion little > instantiations of unknown classes with unknown side effects .. > ... arghhh. I think it is important to be able to access a system from a Palm Pilot-like device as well as from a conference room "whiteboard"-size device. If a client does use Java/Swing/AWT I think it should be possible to use a small set of bells and whistles. Just one other person's opinion, but I concur. Large GUI gadget applications can be a mess. They also tend not to be very easy to get right across multiple platforms. -- Patrick D. Logan mailto:patrickdlogan@REDACTED "I have a mind like a steel... uh... thingy." From joe@REDACTED Mon Mar 22 12:09:35 1999 From: joe@REDACTED (Joe Armstrong) Date: Mon, 22 Mar 1999 12:09:35 +0100 (MET) Subject: [Fwd: A small problem in lazy-evaluation.] In-Reply-To: <36F609D0.6B902493@erlang.ericsson.se> Message-ID: Hello, This is an answer to your question about lazy lists that you sent to Anna [I've also cross posted to erlang-questions@REDACTED]. .... There were a number of problems with you program - they all stemmed from the same error. Your first function was wrong, recall that you wrote: %% This generates a lazy sequence starting from K. from(K) -> fun() -> [K| from(K+1)] end. This is too lazy, you need a list with an eager head and lazy tail like this: from(K) -> [K | fun() -> from(K+1)]. I then changed the representation of a lazy list to the above form in your program and it now works fine. I also added a function first(N) which forces evaluation of the first N elemnts in the lazy list, so you can see that it works. Just printing something in Erlang will not force evaluation. > p3:first(20). generated:2 generated:3 generated:5 generated:7 generated:11 generated:13 generated:17 generated:19 generated:23 generated:29 generated:31 generated:37 generated:41 generated:43 generated:47 generated:53 generated:59 generated:61 generated:67 generated:71 true /Joe Here's the modified program -module(p3). -export([from/1,filter/2,sift/2,sieve/1,primes/0, first/1]). %% This generates a lazy sequence starting from K. %% from(K) -> %% fun() -> %% [K| from(K+1)] %% end. from(K) -> [K|fun()->from(K+1)end]. %% This applies the Pred to each element of the list and returns a list %% containing those elements which satisfies Pred. filter(Pred,[]) -> []; filter(Pred,[H|Tl]) -> case Pred(H) of true -> [H|fun() -> filter(Pred,Tl()) end]; false -> filter(Pred,Tl()) end. %% This function simply calls filter/2. sift(P,L) -> filter(fun(N) -> N rem P /= 0 end,L). %% This generates a lazy list after removing all the multiples of H. sieve([H|Tl]) -> [H|fun() -> sieve(sift(H,Tl())) end]. %% This generates the list of prime numbers. primes() -> sieve(from(2)). first(N) -> first(N, primes()). first(0, _) -> true; first(N, [X|P]) -> io:format("generated:~p~n",[X]), P1 = P(), first(N-1, P1). /Joe PS - questions about erlang are best sent to erlang-questions@REDACTED - read http://www.erlang.org/faq.html for more information about this list. -- Joe Armstrong Computer Science Laboratory +46 8 719 9452 AT2/ETX/DN/SU Ericsson Telecom SE-126 25 Stockholm Sweden joe@REDACTED http://www.ericsson.se/cslab/~joe From crd@REDACTED Thu Mar 25 18:50:02 1999 From: crd@REDACTED (Craig Dickson) Date: Thu, 25 Mar 1999 09:50:02 -0800 Subject: Performance question Message-ID: <005a01be76e7$ebbfefa0$6e02a8c0@int2.inversenet.com> I have an algorithm which requires a recursive function to have access to a fairly large fixed-size array of constants (probably a tuple, indexable with element/2 since that should have O(1) performance, and it won't need to be anywhere near 64k elements long). My question is, if I simply declare this tuple as a value within the function, will it be recreated for each recursive call to the function, or is Erlang smart enough to set it up once (at compile time, even, as pre-initialized static data, since it is never modified) and keep it around for subsequent usage? Would it make any difference if the tuple was passed in as an argument? Incidentally, why is there no recognizer guard for funs? If you don't mind having your code assume that a fun is a certain type of record, you can use record/2, but I don't recall the standard saying that funs had to be implemented as records, so I'm not comfortable with that. Craig From tobbe@REDACTED Thu Mar 25 23:37:18 1999 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Fri, 26 Mar 1999 09:37:18 +1100 Subject: Performance question In-Reply-To: <005a01be76e7$ebbfefa0$6e02a8c0@int2.inversenet.com> References: <005a01be76e7$ebbfefa0$6e02a8c0@int2.inversenet.com> Message-ID: <199903252237.JAA10713@universe.serc.rmit.edu.au> > I have an algorithm which requires a recursive function to have access to a > fairly large fixed-size array of constants (probably a tuple, indexable with > element/2 since that should have O(1) performance, and it won't need to be > anywhere near 64k elements long). My question is, if I simply declare this > tuple as a value within the function, will it be recreated for each > recursive call to the function, or is Erlang smart enough to set it up once > (at compile time, even, as pre-initialized static data, since it is never > modified) and keep it around for subsequent usage? Well, first of all. If you want to store lots of data I recommend using ets-tables, see the man-page for ets. They give you O(1) performance. Also, under the user-contrib area you'll find an "efficient dynamically expanding array package for heap-based storage". I haven't used it myself but Ulf Wiger (ulf.wiger@REDACTED) can probably give you details about the performance. See: http://www.serc.rmit.edu.au/mirrors/ose_mirror/user.html#dynarray-1.0 Next, there have been problems (in the past at least) when you try to compile a tuple of size > 256. The work around has been to create a list of elements and then use the BIF list_to_tuple/1 . Finally, yes if you don't modify your tuple. Erlang only passes around the reference to it. > Incidentally, why is there no recognizer guard for funs? ... There is: function(F) Cheers /Tobbe From klacke@REDACTED Thu Mar 25 23:41:29 1999 From: klacke@REDACTED (Claes Wikstrom) Date: Thu, 25 Mar 1999 23:41:29 +0100 (MET) Subject: Performance question In-Reply-To: <005a01be76e7$ebbfefa0$6e02a8c0@int2.inversenet.com> References: <005a01be76e7$ebbfefa0$6e02a8c0@int2.inversenet.com> Message-ID: <14074.48025.497423.802798@gin> Craig Dickson writes: > I have an algorithm which requires a recursive function to have access to a > fairly large fixed-size array of constants (probably a tuple, indexable with > element/2 since that should have O(1) performance, and it won't need to be > anywhere near 64k elements long). My question is, if I simply declare this > tuple as a value within the function, will it be recreated for each > recursive call to the function, or is Erlang smart enough to set it up once > (at compile time, even, as pre-initialized static data, since it is never > modified) and keep it around for subsequent usage? Would it make any > difference if the tuple was passed in as an argument? No the current compiler(s), neither jam nor beam does anything particularly inteligent with code like: f(0) -> ok; f(I) -> test(I), f(I-1). test(I) -> T = {x,f,t,y, ........ huge tuple ...} dosomething(T, element(T, I)). T will be rebuilt every loop, this is very costly. We'd better write the code as: f(I) -> f(I, {x,f,t,y, ........ huge tuple ...}). f(0, _) -> ok; f(I, T) -> test(I, T), f(I-1, T). test(I, T) -> dosomething(T, element(T, I)). Now T will only be built once. This absoluteley acceptable since it is what would be typically expected. > > Incidentally, why is there no recognizer guard for funs? If you don't mind > having your code assume that a fun is a certain type of record, you can use > record/2, but I don't recall the standard saying that funs had to be > implemented as records, so I'm not comfortable with that. There is, the guard test function(F) exists, with a little quirk though. First: test() -> a(fun(X) -> X end). a(F) when function(F) -> function; a(F) when list(F) -> list. returns the atom 'function', however, and this actually sucks a bit Funs today are tuples, try out 1> tuple_to_list(fun(X) -> X end) and cry. Hopefully this will be fixed real soon. So, test2() -> b(fun(X) -> X end). b(F) when tuple(F) -> tuple; b(F) when function(F) -> F. actually returns the atom 'tuple'. This is no big deal in real life since we only have to test for functions before tuples if we want to discriminate on types in clause mathing. Cheers /klacke From "mickael_remond"@REDACTED Fri Mar 26 15:43:54 1999 From: "mickael_remond"@REDACTED ("mickael_remond"@REDACTED) Date: Fri, 26 Mar 1999 15:43:54 +0100 Subject: Database questions Message-ID: I have two questions concerning Erlang and databases : - About Mnesia : Is there a way to use several attributes as one key in a Mnesia table ? - About SqlErlang : SqlErlang has been written to interface Erlang with Oracle. Does someone tried to modify this library to modify it to run with other RDBMS ? And I will finish with a general questions about Erlang and databases : What are the plans with Erlang and databases ? Will it smoothly include the RDBMS library ? Will Erlang integrate interfaces to other RDBMS ? Thank you in advance for your answers. Mickael Remond From hakan@REDACTED Fri Mar 26 16:10:03 1999 From: hakan@REDACTED (Hakan Mattsson) Date: Fri, 26 Mar 1999 16:10:03 +0100 (MET) Subject: Database questions In-Reply-To: Message-ID: On Fri, 26 Mar 1999 mickael_remond@REDACTED wrote: mickael> Date: Fri, 26 Mar 1999 15:43:54 +0100 mickael> From: mickael_remond@REDACTED mickael> To: erlang-questions@REDACTED mickael> Subject: Database questions mickael> mickael> I have two questions concerning Erlang and databases : mickael> mickael> - About Mnesia : mickael> Is there a way to use several attributes as one key in a Mnesia table ? No, but the key kan be an arbritary complex Erlang term. You can for example let a record or tuple to constitute a structured key. mickael> - About SqlErlang : mickael> SqlErlang has been written to interface Erlang with Oracle. Does someone mickael> tried to modify this library to modify it to run with other RDBMS ? mickael> mickael> And I will finish with a general questions about Erlang and databases : mickael> What are the plans with Erlang and databases ? Will it smoothly include the mickael> RDBMS library ? Will Erlang integrate interfaces to other RDBMS ? In the new OTP R5 release there is an Erlang binding to ODBC. With this you will be able to interface a wide range of relational DBMS's. Best Regards H?kan ---------------------------------------------------------------------- H?kan Mattsson | Phone: +46 8 719 92 51 Computer Science Lab | Fax: +46 8 719 89 88 Ericsson Network Core Products | Box 1505 | E-mail: hakan@REDACTED S-126 25 ?lvsj?, Sweden | http://www.ericsson.se/cslab/~hakan From mattias@REDACTED Fri Mar 26 17:31:40 1999 From: mattias@REDACTED (Mattias Nilsson) Date: Fri, 26 Mar 1999 17:31:40 +0100 Subject: Database questions Message-ID: <36FBB66C.AAB15213@erix.ericsson.se> Hakan Mattsson wrote: > > On Fri, 26 Mar 1999 mickael_remond@REDACTED wrote: > > mickael> Date: Fri, 26 Mar 1999 15:43:54 +0100 > mickael> From: mickael_remond@REDACTED > mickael> To: erlang-questions@REDACTED > mickael> Subject: Database questions > mickael> > mickael> I have two questions concerning Erlang and databases : > mickael> > mickael> - About Mnesia : > mickael> Is there a way to use several attributes as one key in a Mnesia table ? > > No, but the key kan be an arbritary complex Erlang term. > You can for example let a record or tuple to constitute a structured key. > > mickael> - About SqlErlang : > mickael> SqlErlang has been written to interface Erlang with Oracle. Does someone > mickael> tried to modify this library to modify it to run with other RDBMS ? > mickael> > mickael> And I will finish with a general questions about Erlang and databases : > mickael> What are the plans with Erlang and databases ? Will it smoothly include the > mickael> RDBMS library ? Will Erlang integrate interfaces to other RDBMS ? > > In the new OTP R5 release there is an Erlang binding to ODBC. With > this you will be able to interface a wide range of relational DBMS's. Perhaps it should be mentioned that the ODBC library for OTP R5 will only be released on Solaris and Windows at this moment, not saying it won't ever be released on other platforms aswell. -- Best Regards, Mattias Nilsson Open Telecom Platform, Open Systems, Ericsson From crd@REDACTED Tue Mar 30 23:14:10 1999 From: crd@REDACTED (Craig Dickson) Date: Tue, 30 Mar 1999 13:14:10 -0800 Subject: Guard questions Message-ID: <00c801be7af2$43b40c60$6e02a8c0@int2.inversenet.com> (1) Why is there no way to express "or" in a list of guards? "f(x) when a, b" means "f(x) when a and b", but there seems to be no way to say "f(x) when a or b"; instead, you have to say "f(x) when a -> do_something; f(x) when b -> do_something." It's a mild annoyance at worst, but a curious one. It seems to me that it would have been more obvious to use "and" instead of the comma between guards, and allowed "or" and "xor" as well. I suspect there was a conscious intent behind this design, but the reasoning behind it is not obvious to me. (2) Is there any behavioral or performance difference between the expressions 2a and 2b below? It seems to me that they ought to be equivalent. Are there technical or stylistic reasons to prefer one over the other? (I tend to prefer 2b except when I need to refer to the whole record in the function.) (2a) f(X) when record(X, x) -> X#x.field. (2b) f(#x{field = Field}) -> Field. Thanks, Craig From crd@REDACTED Tue Mar 30 23:17:08 1999 From: crd@REDACTED (Craig Dickson) Date: Tue, 30 Mar 1999 13:17:08 -0800 Subject: guard BIF function/1 References: <005a01be76e7$ebbfefa0$6e02a8c0@int2.inversenet.com> <14074.48025.497423.802798@gin> Message-ID: <00cd01be7af2$ae29c580$6e02a8c0@int2.inversenet.com> Claes Wikstrom wrote: >Craig Dickson writes: >> >>Incidentally, why is there no recognizer guard for funs? If you don't mind >>having your code assume that a fun is a certain type of record, you can use >>record/2, but I don't recall the standard saying that funs had to be >>implemented as records, so I'm not comfortable with that. > > There is, the guard test function(F) exists [...] Okay, thanks. This guard BIF does not seem to be mentioned in the Erlang 0.7 draft specification. Craig From erlang-maintainers@REDACTED Tue Mar 30 23:38:39 1999 From: erlang-maintainers@REDACTED (erlang-maintainers@REDACTED) Date: 30 Mar 1999 23:38:39 +0200 Subject: Fifth International Erlang/OTP User Conference 1999 Message-ID: [For more info see http://www.erlang.se/info/] PRELIMINARY CALL FOR PAPERS EUC99 Fifth International Erlang/OTP User Conference, Stockholm - Sweden, September 28 (preliminary date), 1999. Scope of the conference: The conference is concerned with all aspects of using Erlang/OTP. This includes syntax and semantics of the language Erlang, distributed programming, robustness, interoperability, testing, OTP components, application subsystems, software architecture, methodology, best practices, experiences, development practices, performance issues, new application areas, high availability, compiler technology, tools. Conference Chair: To be announced Program Co-Chairs: Torbj?rn Keisu, Ericsson Utvecklings AB, Software Architecture Research Center, (keisu@REDACTED) Lennart ?hman, Ericsson Utvecklings AB, Erlang Systems (lennart@REDACTED) Fax +46 8 719 89 40 P.O. Box 1214 SE-164 28 Kista SWEDEN Paper submissions: The programme committee practises a relaxed paper submission policy. Authors are *not* required to produce a formal paper. As an alternative, authors may use their final version of their presentation material accompanied by appropriate speakers notes. Authors should submit an abstract (max. 200 words) outlining the presentation by May 7. Notification of acceptance will be given at latest by May 31. Accepted contributions must be presented in full by August 27, either as a formal paper or according to alternative option above. Submission should be done by sending an email containing the title, authors, presenter and abstract of the paper in plain text using the address euc99@REDACTED For authors who are unable to submit electronically, contact the program chairs at euc99@REDACTED Important dates: -- May 7, 1999: abstract submissions -- May 31, 1999: acceptance decisions -- August 27, 1999: full paper submissions -- Sept 28, 1999: conference From joe@REDACTED Wed Mar 31 09:33:41 1999 From: joe@REDACTED (Joe Armstrong) Date: Wed, 31 Mar 1999 09:33:41 +0200 (MET DST) Subject: Guard questions In-Reply-To: <00c801be7af2$43b40c60$6e02a8c0@int2.inversenet.com> Message-ID: > (1) Why is there no way to express "or" in a list of guards? "f(x) when a, > b" means "f(x) when a and b", but there seems to be no way to say "f(x) when > a or b"; instead, you have to say "f(x) when a -> do_something; f(x) when > b -> do_something." It's a mild annoyance at worst, but a curious one. It > seems to me that it would have been more obvious to use "and" instead of the > comma between guards, and allowed "or" and "xor" as well. I suspect there > was a conscious intent behind this design, but the reasoning behind it is > not obvious to me. > It's a feature :-) - I quite agree it's silly - this is one of the things that will be fixed in Erlang 5.0. The reason why its like this is that compiling "and" guards was much easier. The origonal JAM was much like the prolog WAM so the compiler turned this: Clause1 when Guard1 -> Body1 Clause2 when Guard2 -> Body2 ... into: tryMeElse L1 ... pattern match the head of the Clause 1 and get things into registers ... testGuard1 this has instructions like test(Var, int) which fail to the current "tryMeElse" label commit ... compile Body2 L1: tryMeElse L2 ... etc. - so compiling "and" guards was easy - if any test fails you just jump to a label at the start of the next clause. Compiling "ors" needed a slighty different instruction set - and didn't get done in the origonal JAM. After the JAM started spreading it was too late and "ors" in guards never got high priority. > (2) Is there any behavioral or performance difference between the > expressions 2a and 2b below? It seems to me that they ought to be > equivalent. Are there technical or stylistic reasons to prefer one over the > other? (I tend to prefer 2b except when I need to refer to the whole record > in the function.) > > (2a) f(X) when record(X, x) -> X#x.field. > > (2b) f(#x{field = Field}) -> Field. They should be equivalent. As for performance I don't know - I'm alergic to performance questions :-) I get a nasty red rash and come out in spots. Even If I knew that 2a) was faster than 2b) for a particular compiler I would never [1] use that information - 'cos in the next compiler it might be the other way around. Joe's law: Choose the most beautiful. In this case particular case I wonder why you use a function to abstract out the record. If "x" was a car and "field" a wheel At the site of the call you'd write W = wheel(C), or, W = C#car.wheel, But [by extension] making lots of small selector functions would clutter up the function namespace and be inefficient. So the answer is neither 2a) or 2b) /Joe [1] Except If I was really really really forced to do so - i.e. life and death stuff - if you make the performace hack your product works, otherwise it fails. Remember "every line of code you write will one day have to be maintained by somebody" From crd@REDACTED Wed Mar 31 15:27:04 1999 From: crd@REDACTED (Craig Dickson) Date: Wed, 31 Mar 1999 05:27:04 -0800 Subject: Guard questions References: Message-ID: <010b01be7b7a$2dd653c0$6e02a8c0@int2.inversenet.com> Joe Armstrong wrote: > > (2a) f(X) when record(X, x) -> X#x.field. > > > > (2b) f(#x{field = Field}) -> Field. > > In this case particular case I wonder why you > use a function to abstract out the record. Oh, that was just to provide enough of an example to demonstrate the two possible ways of expressing the idea that the function expected an x record as its argument, but only really wanted a field or two from it. I wouldn't really use a function just to pull a named field out of a record! But sometimes I've had functions that took records, but didn't really need the record as such, only the fields; in those cases, I considered it best just to take the record as an argument, but declare names for the field values in the function head, as in (2b). My question was really whether the two heads will behave any differently; (2a) is clearly going to be bypassed if X is not of type record(x), and I was pretty sure the same was true of (2b), but I thought I might as well ask the experts even though it seems to be working. (You never know -- there might be some non-obvious reason to prefer (2a).) Thanks for your reply! Craig From luke@REDACTED Wed Mar 3 03:24:57 1999 From: luke@REDACTED (Luke Gorrie) Date: 03 Mar 1999 12:24:57 +1000 Subject: Beginner problem with Mnemosyne Message-ID: <678jwbra.fsf@javagroup.org> Hi all, I've just started playing with Mnesia, but I'm having a small problem with some code based on the provided examples. On the function: get_me() -> Q = query [E.name || E <- table(employee), E.sex = male] end, F = fun() -> mnemosyne:eval(Q) end, mnesia:transaction(F). During compilation I get the error message: mnemosyne query, missing transformation Could someone please point me in the right direction? (Complete problem code attached). -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: company.hrl URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: company.erl URL: -------------- next part -------------- -- Luke Gorrie http://www.vegetable.org/ From luke@REDACTED Fri Mar 5 17:51:21 1999 From: luke@REDACTED (Luke Gorrie) Date: 06 Mar 1999 02:51:21 +1000 Subject: Archive? Message-ID: Hi all, I'm just wondering if this list is archived on the web somewhere? If not, perhaps we could subscribe www.mail-archive.org to this list. It might be a help for people who want to sniff around and see what people are getting up to with Erlang. Cheers, Luke From luke@REDACTED Sun Mar 7 02:47:59 1999 From: luke@REDACTED (Luke Gorrie) Date: 07 Mar 1999 11:47:59 +1000 Subject: Archive? In-Reply-To: Per Hedeland's message of "Tue, 13 Apr 1999 00:53:56 +0200 (MET DST)" References: <199904122253.AAA13978@super.du.etx.ericsson.se> Message-ID: <4snyt6i8.fsf@javagroup.org> Per Hedeland writes: > Luke Gorrie wrote: > >I'm just wondering if this list is archived on the web somewhere? > > Not as far as the list maintainers know...:-) However archives are kept, > and are retrievable with the standard Majordomo commands - send a > message with just the word "help" (no quotes of course) in the body to > majordomo@REDACTED to find out the details. Ah, I didn't realise that majordomo let you lookup archives via email -- thanks for the pointer. > >If not, perhaps we could subscribe www.mail-archive.org to this list. > > I'll have to reveal my ignorance by asking what that is (I can guess the > general idea of course) - also the URL http://www.mail-archive.org/ > doesn't exist ("host not found")... Ooops! That should have been ".com". It's a free service which creates a searchable archive of a mailing list on the web. It's very administratively easy - you just subscribe a special address at their site to the mailing list and the rest is automatic. It also does things like stripping posters' email addresses from the archives, and doesn't seem to be a spam-risk. But, with majordomo already giving access to the archives, it might be superfluous. Cheers, Luke From luke@REDACTED Sun Mar 7 13:32:10 1999 From: luke@REDACTED (Luke Gorrie) Date: 07 Mar 1999 22:32:10 +1000 Subject: Problem getting started with Orber Message-ID: <7lstscol.fsf@javagroup.org> Hi all, I could use a hand with a problem I'm having getting started with Orber. I'm trying to find a Naming service using an IOR and use it to lookup another object, however I get the following error when I call "resolve" on the naming service: ** exited: {{badarg,{gen,call, [orber_reqno, #Ref, {'$gen_call',{<0.281.0>,#Ref},get}, infinity]}}, {gen_server,call,[orber_reqno,get,infinity]}} ** I also get this error when I try looking up another object by IOR and calling it. I'm not sure what the problem is, the IOR parses correctly (printing it gives all the right information), but I invariably get this error when I make a call on an object. I suspect I'm doing something silly. :-) The code which is causing the problem is attached. It depends on some supporting classes, but if there is no obvious problem and it would have to be run to reproduce this problem, then the dependency could be easily severed. The ORB at the other end is JavaIDL running on Linux JDK1.2pre1, and Orber is running on the same machine. Thanks for any light you could shed on this! P.S., I'm sorry if the code is ugly, I'm taking my first steps with Erlang. Cheers, Luke -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: erbot.erl URL: