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

Subject: Re: [xsl] How to write (existential) predicates with maps/Why is there no effective boolean value for a map?
From: "Mukul Gandhi gandhi.mukul@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 13 Feb 2019 08:45:38 -0000
On Wed, Feb 13, 2019 at 7:18 AM Dimitre Novatchev dnovatchev@xxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> 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,
https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html
following sample program appears,

<quote>

 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);

</quote>

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
different).




-- 
Regards,
Mukul Gandhi

Current Thread