-login:
user: password:
Polski
huginn - programming language with no quirks, so simple every child can master it.
Fork me on GitHub
git clone https://codestation.org/repo/huginn.git
git clone https://github.com/AmokHuginnsson/huginn.git
git clone https://bitbucket.org/huginn/huginn.git
  1. Syntax
  2. Keywords
  3. Types

    Huginn provides several built-in scalar and collection types, as well as user defined compound types.

    integer real string number character boolean list deque dict order lookup set
  4. Built-ins
  5. Core library classes
  6. Packages

The character is a scalar type that is used to represent and operate on single characters. It supports basic operations of comparisons, case modification and classification.

Methods
  • is_alnum() - tell if this character represents any alphanumeric character
  • is_alpha() - tell if this character represents an alphabet character
  • is_digit() - tell if this character represents decimal digit
  • is_lower() - tell if this character is a lower case character
  • is_space() - tell if this character represents a white space character
  • is_upper() - tell if this character is an upper case character
  • is_xdigit() - tell if this character represents a hexadecimal digit
  • to_lower() - make this character lower case
  • to_upper() - make this character upper case
Editor (vim) - character.hgn (Try it online!) [+line no]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#! /bin/sh
exec huginn --no-argv -E "${0}" "${@}"
#! huginn

is( x ) {
	return ( x ? "is" : "is not" );
}

main() {
	c = 'f';
	print( "type of c is {}\n".format( type( c ) ) );
	print( "value of c is {}\n".format( c ) );
	print( "c is {}case character\n".format( c.is_upper() ? "upper" : "lower" ) );
	c.to_upper();
	print( "now value of c is {}\n".format( c ) );
	s = "Hello";
	print( "type of s[0] is {}\n".format( type( s[0] ) ) );
	print( "value of s[0] is {}\n".format( s[0] ) );
	print( "s[0] is {}case character\n".format( ! s[0].is_lower() ? "upper" : "lower" ) );
	print( "c {} hexadecimal\n".format( is( c.is_xdigit() ) ) );
	print( "s[0] {} hexadecimal\n".format( is( s[0].is_xdigit() ) ) );
	return ( 0 );
}

Program output:

Terminal - shell session [–line no]
[amok@vegeta](2/1)~/$ ./character.hgn
type of c is character
value of c is f
c is lowercase character
now value of c is F
type of s[0] is character
value of s[0] is H
s[0] is uppercase character
c is hexadecimal
s[0] is not hexadecimal
[amok@vegeta](2/1)~/$