January 11, 2009
Hello Nick,

> But, of course, adjectives (just like "direct/indirect objects") are
> themselves nouns.
> 


Umm... May I make a little correction here?  

Adjectives are not nouns.  They are used to /describe/ nouns.

-JJR


January 12, 2009
On 1/11/2009 9:32 PM, Denis Koroskin wrote:
> I'd also note that using foo without either "&" or "()" is still
> necessary to get access to foo's set of properties:
>
> auto s = foo.stringof;
> auto m = foo.mangleof;
> // etc

As far as I understand calling built-in properties eg. ``foo.stringof()`` is not allowed. And it is not an lvalue. So no referencing of a built-in properties possible either.

I find this behavior most suitable for properties. The only exception is built-in ``.reverse`` and ``.sort`` properties which seems counter intuitive to me to be used without (). I think this should be something callable (built-in functions, inherited methods, etc.) rather than properties.

-- serg.
January 12, 2009
"John Reimer" <terminal.node@gmail.com> wrote in message news:28b70f8c119528cb42154f5d14e0@news.digitalmars.com...
> Hello Nick,
>
>> But, of course, adjectives (just like "direct/indirect objects") are
>> themselves nouns.
>>
>
>
> Umm... May I make a little correction here?
> Adjectives are not nouns.  They are used to /describe/ nouns.
>
> -JJR
>

Maybe there's examples I'm not thinking of, and I'm certainly no natural language expert, but consider these:

"red"
"ball"
"red ball"

By themselves, "red" and "ball" are both nouns. Stick the noun "red" in front of ball and "red" becomes an adjectve. (FWIW, "dictionary.reference.com" lists "red" as both a noun and an adjective). The only adjectives I can think of at the moment (in my admittedly quite tired state) are words that are ordinarly nouns on their own.  I would think that the distinguishing charactaristic of an adjective vs noun would be the context in which it's used.

Maybe I am mixed up though, it's not really an area of expertise for me.


January 12, 2009
On Sun, Jan 11, 2009 at 11:02 PM, Nick Sabalausky <a@a.a> wrote:
>
> Maybe there's examples I'm not thinking of, and I'm certainly no natural language expert, but consider these:
>
> "red"
> "ball"
> "red ball"
>
> By themselves, "red" and "ball" are both nouns. Stick the noun "red" in front of ball and "red" becomes an adjectve. (FWIW, "dictionary.reference.com" lists "red" as both a noun and an adjective). The only adjectives I can think of at the moment (in my admittedly quite tired state) are words that are ordinarly nouns on their own.  I would think that the distinguishing charactaristic of an adjective vs noun would be the context in which it's used.
>
> Maybe I am mixed up though, it's not really an area of expertise for me.

That "red" can be used as both a noun and as an adjective is just a coincidence.  Well, it's not entirely coincidental - there are many adjectives which have been nominalized like this.  Some other languages (like Spanish) allow you to use an adjective as a noun, in which case it's like saying "<adjective> one" i.e. "el gordo" = "the fat [one]".  In English, though, that process is far from productive. Consider the adjectives "sleepy", "hard", or "loud".  There are of course nominalized forms of these - sleepiness, hardness, loudness - but they're separate words.
January 12, 2009
Hello Nick,

> "John Reimer" <terminal.node@gmail.com> wrote in message
> news:28b70f8c119528cb42154f5d14e0@news.digitalmars.com...
> 
>> Hello Nick,
>> 
>>> But, of course, adjectives (just like "direct/indirect objects") are
>>> themselves nouns.
>>> 
>> Umm... May I make a little correction here?
>> Adjectives are not nouns.  They are used to /describe/ nouns.
>> -JJR
>> 
> Maybe there's examples I'm not thinking of, and I'm certainly no
> natural language expert, but consider these:
> 
> "red"
> "ball"
> "red ball"
> By themselves, "red" and "ball" are both nouns. Stick the noun "red"
> in front of ball and "red" becomes an adjectve. (FWIW,
> "dictionary.reference.com" lists "red" as both a noun and an
> adjective). The only adjectives I can think of at the moment (in my
> admittedly quite tired state) are words that are ordinarly nouns on
> their own.  I would think that the distinguishing charactaristic of an
> adjective vs noun would be the context in which it's used.
> 
> Maybe I am mixed up though, it's not really an area of expertise for
> me.
> 


No problem.  I am not saying a word can't be /used/ as an adjective and noun in different contexts.  I'm just saying that they can't be an adjective and noun at the same time as your first post suggested.

Grammatically, adjectives are not nouns (ever), even if the words themselves can be used as either in independent contexts; they just modify nouns.  Like Jarett mentions, the fact that words that are adjectives in one context can shapeshift to another part of speech (the noun) in another, is immaterial to the definition: you just have to recognize when it happens and realize the change that has occurred in the part of speech.

It something like how D uses the "!" prefix to instantiate a template and in another context uses it as a logical NOT.  They can't mean both at the same time.  They mean something different depending on where they are used.

-JJR


January 12, 2009
On Mon, 12 Jan 2009 04:27:09 +0300, Sergey Kovrov <kovrov@gmail.com> wrote:

> On 1/11/2009 9:32 PM, Denis Koroskin wrote:
>> I'd also note that using foo without either "&" or "()" is still
>> necessary to get access to foo's set of properties:
>>
>> auto s = foo.stringof;
>> auto m = foo.mangleof;
>> // etc
>
> As far as I understand calling built-in properties eg. ``foo.stringof()`` is not allowed. And it is not an lvalue. So no referencing of a built-in properties possible either.
>

'&' and '()' were to be applied to foo rather that foo.property in the original message (i.e. &foo and foo()). I just provided example where neither '&' nor '()' were needed when accessing foo.

> I find this behavior most suitable for properties. The only exception is built-in ``.reverse`` and ``.sort`` properties which seems counter intuitive to me to be used without (). I think this should be something callable (built-in functions, inherited methods, etc.) rather than properties.
>
> -- serg.

Absolutely agree here.

January 12, 2009
Nick Sabalausky wrote:
> void func(ref int x) {...}
> func(foo.aProperty);
> 
> void func(int* x) {...}
> func(&foo.aProperty);
> 
> *Should* work with both variables and properties (but might need some thinking in how to actually pull it off correctly. Someone mentioned C# just doesn't even bother with it.)

That just can't work without radically changing what a pointer is. Disallowing pointers to properties is really the best fix.

If you really wanted, you might be able to wrap a getter/setter pair into a struct and pass that instead (and have default getter/setter templates for non-properties).
It's probably easier to just pass in getter/setter delegates explicitly though.
January 12, 2009
"Frits van Bommel" <fvbommel@REMwOVExCAPSs.nl> wrote in message news:gkfmr2$1n9j$1@digitalmars.com...
> Nick Sabalausky wrote:
>> void func(ref int x) {...}
>> func(foo.aProperty);
>>
>> void func(int* x) {...}
>> func(&foo.aProperty);
>>
>> *Should* work with both variables and properties (but might need some thinking in how to actually pull it off correctly. Someone mentioned C# just doesn't even bother with it.)
>
> That just can't work without radically changing what a pointer is. Disallowing pointers to properties is really the best fix.
>
> If you really wanted, you might be able to wrap a getter/setter pair into
> a struct and pass that instead (and have default getter/setter templates
> for non-properties).
> It's probably easier to just pass in getter/setter delegates explicitly
> though.

What if properties were internally defined to be a struct of two delegates (and maybe the internal value)? Although that would still leave an issue of compatibility between int* and (property int)*, and might prevent the intrnal value from being optimized away...


January 12, 2009
"John Reimer" <terminal.node@gmail.com> wrote in message news:28b70f8c119bd8cb4246de86cc80@news.digitalmars.com...
> Hello Nick,
>
>> "John Reimer" <terminal.node@gmail.com> wrote in message news:28b70f8c119528cb42154f5d14e0@news.digitalmars.com...
>>
>>> Hello Nick,
>>>
>>>> But, of course, adjectives (just like "direct/indirect objects") are
>>>> themselves nouns.
>>>>
>>> Umm... May I make a little correction here?
>>> Adjectives are not nouns.  They are used to /describe/ nouns.
>>> -JJR
>>>
>> Maybe there's examples I'm not thinking of, and I'm certainly no natural language expert, but consider these:
>>
>> "red"
>> "ball"
>> "red ball"
>> By themselves, "red" and "ball" are both nouns. Stick the noun "red"
>> in front of ball and "red" becomes an adjectve. (FWIW,
>> "dictionary.reference.com" lists "red" as both a noun and an
>> adjective). The only adjectives I can think of at the moment (in my
>> admittedly quite tired state) are words that are ordinarly nouns on
>> their own.  I would think that the distinguishing charactaristic of an
>> adjective vs noun would be the context in which it's used.
>>
>> Maybe I am mixed up though, it's not really an area of expertise for me.
>>
>
>
> No problem.  I am not saying a word can't be /used/ as an adjective and noun in different contexts.  I'm just saying that they can't be an adjective and noun at the same time as your first post suggested.
>
> Grammatically, adjectives are not nouns (ever), even if the words themselves can be used as either in independent contexts; they just modify nouns.  Like Jarett mentions, the fact that words that are adjectives in one context can shapeshift to another part of speech (the noun) in another, is immaterial to the definition: you just have to recognize when it happens and realize the change that has occurred in the part of speech.
>

I guess that's a difference between natural languages and oop-languages then. A member variable of an object typically /describes an attribute/ of the object, and thus makes it comparable to the notion of "adjective", but in an oop-language (and apperently unlike a natural language) that member object is itself either another object or a primitive.

> It something like how D uses the "!" prefix to instantiate a template and in another context uses it as a logical NOT.  They can't mean both at the same time.  They mean something different depending on where they are used.
>

Ok, I see what you're saying.


January 12, 2009
John Reimer wrote:
> Hello Nick,
> 
>> But, of course, adjectives (just like "direct/indirect objects") are
>> themselves nouns.
>>
> 
> 
> Umm... May I make a little correction here? Adjectives are not nouns.  They are used to /describe/ nouns.
> 
> -JJR

No programming language that I know distinguishes parts of an object (the hand of a body) from attributes of an object (the color of a ball). I think that's what he was getting at.