Csound Csound-dev Csound-tekno Search About

[Cs-dev] direct string comparision?

Date2012-01-28 21:35
Fromjoachim heintz
Subject[Cs-dev] direct string comparision?
hi -

is there any chance to come to a direct string comparision with the new
parser?
for instance:



instr cmp
if "a" == "a" then
prints "well done\n"
endif
endin


i "cmp" 0 1



instead of:



instr cmp
i_a strcmp "a", "a"
if i_a == 0 then
prints "well done\n"
endif
endin


i "cmp" 0 1



(which is very clumsy if there are many comparisions)

thanks -

	joachim

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-01-29 01:37
FromRory Walsh
SubjectRe: [Cs-dev] direct string comparision?
That would be nice!

On 28 January 2012 21:35, joachim heintz  wrote:
> hi -
>
> is there any chance to come to a direct string comparision with the new
> parser?
> for instance:
>
> 
> 
> instr cmp
> if "a" == "a" then
> prints "well done\n"
> endif
> endin
> 
> 
> i "cmp" 0 1
> 
> 
>
> instead of:
>
> 
> 
> instr cmp
> i_a strcmp "a", "a"
> if i_a == 0 then
> prints "well done\n"
> endif
> endin
> 
> 
> i "cmp" 0 1
> 
> 
>
> (which is very clumsy if there are many comparisions)
>
> thanks -
>
>        joachim
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-01-29 17:49
FromTito Latini
SubjectRe: [Cs-dev] direct string comparision?
AttachmentsNone  

Date2012-01-29 17:57
Fromjoachim heintz
SubjectRe: [Cs-dev] direct string comparision?
well done! (and certainly useful)
in git?
	joachim

Am 29.01.2012 18:49, schrieb Tito Latini:
> With 6 lines of code I have
> 
> instr 1
>   if strcmp("foo", "foo") == 0 then
>     prints "well done ?\n"
>   else
>     prints "noooooooooooooo\n"
>   endif
> 
>   print strcmp("foo", "foo")
>   print strcmp("foo", "bar")
>   printk2 strcmpk("foo", "foo")
>   printk2 strcmpk("foo", "bar")
> endin
> 
> ...
> new alloc for instr 1:
> well done ?
> instr 1:  #i1 = 0.000
> instr 1:  #i2 = 1.000
>  i1     0.00000
>  i1     1.00000
> ...
> 
> Is it useful ?
> 
> tito
> 
> On Sun, Jan 29, 2012 at 01:37:51AM +0000, Rory Walsh wrote:
>> That would be nice!
>>
>> On 28 January 2012 21:35, joachim heintz  wrote:
>>> hi -
>>>
>>> is there any chance to come to a direct string comparision with the new
>>> parser?
>>> for instance:
>>>
>>> 
>>> 
>>> instr cmp
>>> if "a" == "a" then
>>> prints "well done\n"
>>> endif
>>> endin
>>> 
>>> 
>>> i "cmp" 0 1
>>> 
>>> 
>>>
>>> instead of:
>>>
>>> 
>>> 
>>> instr cmp
>>> i_a strcmp "a", "a"
>>> if i_a == 0 then
>>> prints "well done\n"
>>> endif
>>> endin
>>> 
>>> 
>>> i "cmp" 0 1
>>> 
>>> 
>>>
>>> (which is very clumsy if there are many comparisions)
>>>
>>> thanks -
>>>
>>>        joachim
>>>
>>> ------------------------------------------------------------------------------
>>> Try before you buy = See our experts in action!
>>> The most comprehensive online learning library for Microsoft developers
>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>> http://p.sf.net/sfu/learndevnow-dev2
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-01-29 18:30
FromTito Latini
SubjectRe: [Cs-dev] direct string comparision?
AttachmentsNone  

Date2012-01-29 18:39
FromRory Walsh
SubjectRe: [Cs-dev] direct string comparision?
strcomp and strcompk?

On 29 January 2012 18:30, Tito Latini  wrote:
> It is not possible to use the same name for the func
> and the opcode. We have to find a name for the string functions
> related to strcmp and strcmpk. Ideas?
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-01-29 18:40
FromTito Latini
SubjectRe: [Cs-dev] direct string comparision?
AttachmentsNone  

Date2012-01-29 18:42
Fromjoachim heintz
SubjectRe: [Cs-dev] direct string comparision?
hmm ...
in hannover, i understood from something john was saying, that one
benefit of the new parser can be to allow a more functional syntax.
so i am not sure if it is wise to add some functions now. perhaps it is
better to wait until the new feature is possible, and many opcodes can
be written as opcode(arg1, arg2)?
	joachim

Am 29.01.2012 19:30, schrieb Tito Latini:
> It is not possible to use the same name for the func
> and the opcode. We have to find a name for the string functions
> related to strcmp and strcmpk. Ideas?
> 
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-01-29 18:47
FromTito Latini
SubjectRe: [Cs-dev] direct string comparision?
AttachmentsNone  

Date2012-01-29 18:57
FromTito Latini
SubjectRe: [Cs-dev] direct string comparision?
AttachmentsNone  

Date2012-01-29 19:30
FromSteven Yi
SubjectRe: [Cs-dev] direct string comparision?
Question for all: is it worth adding new functions, or is it better to
wait and try to get the parser to allow calling opcodes as functions?

On Sun, Jan 29, 2012 at 1:57 PM, Tito Latini  wrote:
> For example, with a new strcmp??? function, a new symbol is added only.
> Internally, the function becomes the strcmp opcode.
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-01-29 19:58
FromTito Latini
SubjectRe: [Cs-dev] direct string comparision?
AttachmentsNone  

Date2012-01-29 20:17
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] direct string comparision?
It might be easier to implement == as an operator between strings as
originally suggested.
==John ff

> Question for all: is it worth adding new functions, or is it better to
> wait and try to get the parser to allow calling opcodes as functions?
>
> On Sun, Jan 29, 2012 at 1:57 PM, Tito Latini 
> wrote:
>> For example, with a new strcmp??? function, a new symbol is added only.
>> Internally, the function becomes the strcmp opcode.
>>
>>



------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-01-29 20:18
From"Dr. Richard Boulanger"
SubjectRe: [Cs-dev] direct string comparision?
AttachmentsNone  None  
I like both.
___________________________________

Dr. Richard Boulanger, Ph.D.

Professor of Electronic Production and Design
Professional Writing and Music Technology Division
Berklee College of Music
1140 Boylston Street
Boston, MA 02215-3693

617-747-2485 (office)
774-488-9166 (cell)

____________________________________

____________________________________

____________________________________

On Jan 29, 2012, at 3:17 PM, jpff@cs.bath.ac.uk wrote:

It might be easier to implement == as an operator between strings as
originally suggested.
==John ff

Question for all: is it worth adding new functions, or is it better to
wait and try to get the parser to allow calling opcodes as functions?

On Sun, Jan 29, 2012 at 1:57 PM, Tito Latini <tito.01beta@gmail.com>
wrote:
For example, with a new strcmp??? function, a new symbol is added only.
Internally, the function becomes the strcmp opcode.





------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2012-01-29 20:25
FromTito Latini
SubjectRe: [Cs-dev] direct string comparision?
AttachmentsNone  

Date2012-01-29 20:48
FromTito Latini
SubjectRe: [Cs-dev] direct string comparision?
AttachmentsNone  

Date2012-01-29 22:16
FromAdam Puckett
SubjectRe: [Cs-dev] direct string comparision?
I like == better.

On 1/29/12, Tito Latini  wrote:
> About the functions, I think that a good alias is forever.
> If today I write a function `foo()' as an alias for the foobarbazquux
> opcode, because it's short and many users find it useful, it's to add.
> In an only-opcode-wolrd it's simple to add an alias for the
> foobarbazquux opcode. Therefore, I think that to add a function is not
> a problem if we see it like an alias.
>
> It's a no-fear post and only the opinion of the
> my left neuron (the other doesn't know csound)
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net