Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion (Non)Parametrized modules, inheritance, and R15B02 issues?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tomas Morstein  
View profile  
 More options Oct 12 2012, 4:43 am
From: Tomas Morstein <tomas.morst...@idea.cz>
Date: Fri, 12 Oct 2012 10:42:51 +0200 (CEST)
Local: Fri, Oct 12 2012 4:42 am
Subject: Re: [erlang-questions] (Non)Parametrized modules, inheritance, and R15B02 issues?

> -module(person).
> -record(person, {first_name, last_name}).
> -compile(export_all).
> new(FirstName, LastName) ->
>   #person{first_name = FirstName, last_name = LastName}.
> first_name(Person) ->
>   Perosn#person.first_name.

Ha, that's what I didn't know about!
With this feature, I can start to sleep without nightmares again :-)

> So from point of view of readability there will be no change,
> althought the amount of code in the model module (person.erl) will
> slightly increase.

What's not so big deal since both boss_db and iodb models
are preprocessed (partially generated) by model-compiler.
So only what we will have to do is to change model compiler.

What's more, I believe boss_db could remain backward compatible
because it shouldn't be so problematic to transform
  -model (person, [FirstName, LastName])
to
  -model (person).
  -record (person, {first_name, last_name}).
during the preprocessing, before passing to the Erlang compiler
itself.

With our IODB model compiler, we already do something similar
but in another direction -- we define IODB data fields through
attributes that are in turn used to generate access functions.

Each module that is not wrote as parametrized is automatically
converted to pmod by preprocessor.
It is also automatically extended by another module with
abstract model logic, what's the real problem why I have
started this thread ;-)
_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.