From: Makoto Kuwata Date: 2004-04-03T17:07:18+09:00 Subject: Re: Kwartz feature requests Sorry for late reply. Andreas Schwarz wrote: > > Shu-yu Guo wrote: > > * Ability to specify more than one logic file for a template, should be > > trivial to implement. > > > And you can specify several filename with '-p' option. (It is undocumented yet.) ==================== bash$ kwartz -p file1.plogic,file2.plogic file.html ==================== Shu-yu Guo wrote: > > I would like to see support for ?-terminated methods in conditionals. > For example, something like the following: > > I don't like it very much, because * it is avairable only in Ruby. (Kwartz is designed to be avairable in multi-language.) * it is ambiguous with conditional operator (' ? : '). (Those who use Kwartz are not all Ruby programmer.) However, if you want to use '?-terminated methods' in Kwartz, I consider it. As a workaround, you can write it using raw-code, like the following: Presentation data: -------------------- -------------------- Presentation logic (for eRuby): -------------------- :elem(forum_locked) :::<% if forum.locked? then %> @stag @cont @etag :::<% end %> :end -------------------- Output script(eRuby): -------------------- <% if forum.locked? then %> <% end %> -------------------- For detail, see http://www.kuwata-lab.com/webtech/kwartz/users-guide.en.04.html#pl-rawcode http://www.kuwata-lab.com/webtech/kwartz/users-guide.en.06.html#tips-eruby >The solution seems to be as simple as adding a || chr == ?? in Scanner#word? I may add a command option something like '--enable_special_metbhod=true'. (could you propose better name?), or add a function R() which represents raw-code. (This is just my idea, not a plan.) Presentation data: -------------------- -------------------- Intermediate code: -------------------- :if(R('forum.locked?')) :print('\n') :end -------------------- Output script(Ruby): -------------------- if forum.locked? then print "\n" end -------------------- -- regards, kwa