[Hecl-devel] Fwd: Any objections to a new release?
Brought to you by:
davidw
From: David W. <dav...@gm...> - 2009-08-18 08:07:12
|
forwarded with permission ---------- Forwarded message ---------- From: Zakaria <z4...@gm...> Date: Tue, Aug 18, 2009 at 6:15 AM Subject: Re: [Hecl-devel] Any objections to a new release? To: David Welton <dav...@gm...> Sorry for late reply, but I just got back from business trip and following that we got long weekend. On Wed, Aug 12, 2009 at 5:31 PM, David Welton<dav...@gm...> wrote: > I think Hecl should definitely include code to make this stuff easy > for people - I don't want to just push the phone mapping stuff down > into people's individual Hecl scripts. I think it will take some > effort, and more research, though. Wolfgang is more of an expert than > I am in terms of running Hecl on a wide variety of phones, hopefully > he will have a moment to comment. Wolfgang, have you coming back from your vacation? I would like to ask and discuss about your MIDP 2.0 commands. > I like your code, and think we can use that as the code that Hecl > ships with. Like the one I did for Android, I like the fact that you > can view the source code and edit it. I also like the creativity. > I have gone ahead and committed it, but do think it needs some > modification or at least consideration of various elements. Please go ahead, tear them apart and make it better. > Hecl, not being widely used, doesn't have a defined style that people > need to use, so that means we're also free to define things as we see > fit. That said, your code is a bit different than most Hecl code I've > seen (or written) so far. That's not necessarily a bad thing, but > since this is going to be *the* example script, it's important that we > talk about it a little bit. In particular: > * The : in front of global variables. Distinguishing them like that > is not a bad idea, but I'm undecided whether I'd use it myself. > * proc's with :LeadingColons - I don't really see the benefit. You > know from the structure of Hecl what's a proc: it's always the first > word in a group. With the :globalvars, it also leads to a few too > many :'s around for my tastes:-) I choose the : prefix to make it doesn't collide with the examples. First I use __ prefix but they seem so verbose, so I pick another one. > * Hecl indentation is definitely 4 :-) I know, but on the phone 4 space is too much. Maybe we could make the Canvas based editor and make this a non issue? Any volunteer? > There are also some things that, while I think they are good Hecl, or > sensible, need some thinking about just because script.hcl has to be > held to a high standard, and is something many people will likely look > at. > * 'Short' names. that's very handy if you're editing the script on > the phone, but less so if someone is looking to grab a bit of example > code and use it in their own script. > * Redefining proc makes things confusing. I think it might make more > sense to create your own command along the lines of AliasProc, and add > a comment that it adds a bunch of aliases. Yeah, I'm just trying to test the Hecl limit. > Lastly, your code suggests a few things that might be interesting to > add to Hecl itself: > * Command aliases. Having short commands to type is nice, but the > mechanism you end up using is a bit circuitous, and would be a lot > easier if you could jsut write: > alias /alert lcdui.alert In the long run I would like to make the default command short and to the point, so we don't even need the alias. > * Anonymous commands, which you use ':' for (are you a Forth fan?:-). > That requires some more experimentation, but it's an interesting > idea... Nah, just trying to pick a short command. Here's what I have in mind for Hecl 2.0: set form [form title: "Form Title"] set name [text label: "Name:" text: "Your name here"] $form append $name set cmd [cmd label: Greet llabel: "Greeting"] $form add $cmd { showmsg "Hello [$name get text:]" } $form add [cmd label: Exit llabel: "Exit App"] { midlet.exit } $form show > -- > David N. Welton -- Zakaria z4...@gm... Yahoo!: z4k4ri4 http://tukangprogram.com http://pemula.linux.or.id -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ Sent from Padua, Veneto, Italy |