[Top] [All Lists]

Re: [xsl] How to write (existential) predicates with maps/Why is there no effective boolean value for a map?

2019-02-13 02:45:45
On Wed, Feb 13, 2019 at 7:18 AM Dimitre Novatchev 
dnovatchev(_at_)gmail(_dot_)com <
xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

When I started this I was fairly neutral about it, but I've now used
Javascript enough to form a strong distaste for weak typing.

What about Typescript?

Sorry, if this is off topic.

I've been reading about Typescript, during this thread. On the link,
following sample program appears,


 class Student {
fullName: string; constructor(public firstName: string, public
middleInitial: string, public lastName: string) { this.fullName = firstName
+ " " + middleInitial + " " + lastName; } } interface Person { firstName:
string; lastName: string; } function greeter(person : Person) { return "Hello,
" + person.firstName + " " + person.lastName; } let user = new Student(
"Jane", "M.", "User"); document.body.innerHTML = greeter(user);


I'm not been convinced, how above typescript program can be correct. A
Student object is being created (with the let statement), and it is passed
to the greeter function. The greeter function is defined to accept Person
(interface). In the above program, there is no syntactic link between
Student and Person (class Student is not written implementing the interface
Person, and the structures of class Student and interface Person are

Mukul Gandhi
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
<Prev in Thread] Current Thread [Next in Thread>