[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scripting!
From: |
Michael P. Soulier |
Subject: |
Re: Scripting! |
Date: |
Wed, 30 Apr 2014 22:25:27 -0400 |
I don’t know of one with that exact syntax, although I personally am still
finding it hard to get my head around.
The messaging syntax is originally from smalltalk, I believe, so you could use
that, or use something like Ruby.
mom = Mother.new()
mom.tell(:pleaseBring => ‘beer’, :to => ‘sofa’, :amount => 1)
or better yet
mom.fetch_beer({ |beer| me.drink(beer) })
Python’s not bad either
mom = Mother()
with mom.fetch(beer=1) as beer:
me.drink(beer)
or maybe you want to keep drinking
class Mother:
def fetch(beer):
while True:
if beer: yield Beer()
mom = Mother()
for beer in mom.fetch(beer=1):
me.drink(beer)
Mike
On Apr 30, 2014, at 8:21 PM, Kevin Ingwersen <ingwie2000@googlemail.com> wrote:
> Hey!
>
> To explain this subject just a little. I come from actual web development -
> my roots are deeply in PHP. The only reason I ever learned C++, followed by
> C, was due to the need to write a php extension. But due to my C++ lectures,
> I came across objective-c, and fell in love with its syntax, basicaly x). But
> this made me ask the following question:
>
> Why is this not available in scripting?
>
> A year later, I had to ask:
>
> Is it even possible to use a scripting language, based on ObjC syntax,
> outside of OS X?
>
> To be honest, why is there none? Objective-C is a great language - not just
> for GUI coding. I find that its named parameters are a key-concept. It simply
> makes function calls so much more understandable - even when you return to
> your project a year later. My favorite example that I show friends is an
> actual person. See:
>
> Mother* mom = [[Mother alloc] init];
> [mom pleaseBring:@"beer" to:@"Sofa" withAmount:1];
>
> I do not need to explain this, do I :)
>
> But, I have not given up. Years after my discovery, I have had times where I
> took google searches…and at a random sudden, Objective-J was created! This is
> one amazing concept, as I see it. But the downside: You can’t embed it.
>
> So I wanted to ask this Objective-C community here: Is there a viable,
> cross-platform, scripting language with actual ObjC syntax? If not - why! :)
>
> Before I go and poke people to improve their parsers to add this syntax, I
> wanted to ask around first. I am too young in C++ to write my own scripting
> language at the moment (I started last year september), so I cant just do it
> myself x)
>
> Kind regards, Ingwie.
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep
- Scripting!, Kevin Ingwersen, 2014/04/30
- Re: Scripting!,
Michael P. Soulier <=